This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-05
Channels
- # announcements (23)
- # babashka (23)
- # beginners (48)
- # calva (41)
- # clj-kondo (41)
- # cljs-dev (75)
- # cljsrn (5)
- # clojure (85)
- # clojure-europe (46)
- # clojure-nl (2)
- # clojure-spec (70)
- # clojure-uk (4)
- # clojurescript (52)
- # core-async (2)
- # cursive (16)
- # datahike (2)
- # datomic (4)
- # emacs (15)
- # figwheel-main (2)
- # fulcro (5)
- # gratitude (5)
- # helix (14)
- # introduce-yourself (2)
- # jackdaw (13)
- # keyboards (2)
- # lsp (8)
- # luminus (5)
- # malli (3)
- # meander (12)
- # nextjournal (52)
- # off-topic (19)
- # other-languages (1)
- # overtone (3)
- # pathom (4)
- # podcasts-discuss (1)
- # re-frame (6)
- # reitit (1)
- # releases (2)
- # ring (3)
- # sci (22)
- # shadow-cljs (3)
- # specter (1)
- # testing (3)
- # tools-deps (100)
- # uncomplicate (2)
Hey, is the set of serdes intended to be user-extensible?
because if possible I'd like to be able to use e.g. nippy in some cases.
yes. i’ve extended and used custom nippy serdes before
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.
iirc i just copied the edn2 schema ns then swapped out the internal bits from edn to nippy
https://github.com/FundingCircle/jackdaw/blob/master/src/jackdaw/serdes/edn2.clj
you likely don’t need the :prefix
or :name
fields and can just rely on the defaults clojure provides
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?
Oh I see, it's a part of the consumer options map
ya, just give it the classname and you should be good to go
oh. Hmm. Not ideal to have to write a class for that, but okay.
the serdes ns has :gen-class
💪
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