jackdaw

2021-11-05T17:29:23.000500Z

Hey, is the set of serdes intended to be user-extensible?

2021-11-05T17:30:20.000900Z

because if possible I'd like to be able to use e.g. nippy in some cases.

Darin Douglass 2021-11-05T17:41:00.001300Z

yes. i’ve extended and used custom nippy serdes before

2021-11-05T17:49:20.002Z

Is there somewhere I should look at for how to get started? It seems like the existing serdes have kind of magic stuff with the names of their vars, and I don't see docs on how to add in a custom one.

Darin Douglass 2021-11-05T17:51:36.002500Z

iirc i just copied the edn2 schema ns then swapped out the internal bits from edn to nippy

Darin Douglass 2021-11-05T17:52:24.003200Z

you likely don’t need the :prefix or :name fields and can just rely on the defaults clojure provides

2021-11-05T17:53:21.003900Z

Okay, that looks like it's pretty easy, so I guess the only question I have left is does setting the serdes on the topic like in the streams api example work even if you're using a raw consumer?

2021-11-05T17:54:15.004200Z

Oh I see, it's a part of the consumer options map

Darin Douglass 2021-11-05T17:56:06.004500Z

ya, just give it the classname and you should be good to go

2021-11-05T17:57:04.004900Z

oh. Hmm. Not ideal to have to write a class for that, but okay.

Darin Douglass 2021-11-05T17:57:43.005500Z

the serdes ns has :gen-class 💪

2021-11-05T17:58:55.006600Z

Seems like the arity 2 of consumer just takes something that subclasses Serdes, which is what's generated by calling the Serdes/serdeFrom on the stuff returned from the fn ns, which would avoid that problem