jackdaw

https://github.com/FundingCircle/jackdaw
Raziyeh Mohajer 2020-09-22T07:15:14.005500Z

Hello everyone, I want to use a key.serializer and value.serializer for kafka producer other than Kafka own serializers with jackdaw. this is my code for producer

(def serialize nippy/freeze)

(def Kafka-Edn-Serializer
  (reify Serializer
    (serialize [this topic headers data]
      (serialize data))
    (serialize [this topic data]
      (nippy/freeze data))
    (configure [this _ _])
    (close [this])))

(def producer-config
  {"bootstrap.servers" "localhost:9092"
   "key.serializer"    (-> Kafka-Edn-Serializer
                           .getClass
                           .getName)
   "value.serializer"  (-> Kafka-Edn-Serializer
                           .getClass
                           .getName)
   "acks"              "all"
   "client.id"         "foo"})

(defn -main []
  (jc/producer producer-config)
  )
I can run it in repl with spacesmacs editor but when I use lein run to run this I got following error
Invalid value producer_example$reify__12915 for configuration key.serializer: Class producer_example$reify__12915 could not be found.
How should I solve this problem?

Daniel Stephens 2020-09-22T14:38:10.006700Z

pretty sure you can give it as an instance instead of as the class name which might fix your issue @raziyehmohajer.rms did you try:

{"bootstrap.servers" "localhost:9092"
 "key.serializer" Kafka-Edn-Serializer
 "value.serializer" Kafka-Edn-Serializer
 "acks" "all"
 "client.id" "foo"}

Daniel Stephens 2020-09-23T08:24:13.000100Z

Ahh seems my use is slightly different:

(client/producer
     {:bootstrap.servers brokers
      :client.id client-id
      :acks "all"}
     {:key-serde mj/key-serde
      :value-serde mj/value-serde})
Note that I provide two args instead of one, looks like the implementation in this case passes these directly in as instances.

Daniel Stephens 2020-09-23T08:25:10.000300Z

These are expected to be serdes but hopefully that's okay, they only have the .serializer side called in honesty

Daniel Stephens 2020-09-22T15:24:41.007800Z

is jackdaw still alive 😬 I've been hoping https://github.com/FundingCircle/jackdaw/pull/270 would get merged for quite a while

Darin Douglass 2020-09-22T15:32:24.009300Z

last i heard (months ago) covid hit the admin's schedule hard or something. iirc it was @noisesmith who said that

2020-09-23T09:20:28.000500Z

That sounds like a great idea, keen for not too many forks to be made for this.

Daniel Stephens 2020-09-23T09:31:31.000700Z

Agree, I guess it might be unfair to expect all the original maintainers to come along, but considering the number of PRs it seems like there would be plenty of other people willing to help, myself included!

dakra 2020-09-23T12:20:30.001Z

The thing is that the last commit was only 15. July. So if they're just busy a bit that's perfectly acceptable imho. But if it's really the case that quite a few people would like to contribute but can't because it's still under the fc company account where nobody has access to, then it's different. Personally I just see a bunch of PRs that look good and which I would like to see merged.

2020-09-23T19:27:21.001600Z

I think you still misunderstand - dev moved to london, there's still an active eng team, that team might not be as invested in jackdaw as the us team was but the company still has clojure devs, and last I heard was hiring, just consolidating in london

👍 2
2020-09-23T19:27:37.001800Z

I can't really speak on the rest

Daniel Stephens 2020-09-23T19:55:58.002Z

ahh thanks @noisesmith I had indeed misunderstood. That's more promising, might just need to give it some time after the upheaval to get going again 👍

dakra 2020-09-24T07:13:52.000200Z

ok. thanks for the clarification @noisesmith. Hope they pick up development of jackdaw soon. Quite a few PRs seem ready and just waiting for the merge button to be pressed 😉

Darin Douglass 2020-09-22T15:34:49.010Z

i too am interested in a couple of the pr's currently open against the lib

2020-09-22T15:38:37.010100Z

it was work related to covid that displaced jackdaw work, I (along with the rest of the former US eng team for fc) am no longer working with fc so can't tell you the current situation

Darin Douglass 2020-09-22T15:40:30.010300Z

thanks for the update, it was what i remembered. sorry about the loss of a job. hopefully you found something quick enough

Daniel Stephens 2020-09-22T15:45:43.010500Z

Thanks, both, for the information 👍

Raziyeh Mohajer 2020-09-22T17:13:36.010700Z

@dstephens yes I tried that too I got this error

Invalid value producer_example$reify__38516@76bd8d56 for configuration
   key.serializer: Expected a Class instance or class name.

dakra 2020-09-22T20:56:34.011Z

So does that mean that most (all?) people that developed jackdaw don't have write access to the repo anymore to maintain it? If so, then maybe it would even make sense to fork it and put the original authors back as maintainers? I like jackdaw and currently use it for my project. I, too, would like an update to a newer Kafka version and also very interested in the transducer PR.

👍 2