Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringSerializer/StringDeserializer instead of ByteArraySerializer/ByteArrayDeserializer #60

Open
danieroux opened this issue Nov 16, 2018 · 1 comment

Comments

@danieroux
Copy link

I would really like org.apache.kafka.common.serialization.StringDeserializer for key.deserializer and key.serializer. My data is small <100 byte strings, and being able to kafkacat a topic and read the results would give me great leverage.

This pull request seems to enable what I want, and it was never merged: #55

  • Why was it never merged?
  • Is this more easily done by just adding key.deserializer and key.serializer into the consumer-config and constructing (i.e.) key-deserializer with that, or defaulting to (h/byte-array-deserializer) if it's not defined?
@danieroux danieroux changed the title StringDeserializer instead of ByteArraySerializer StringSerializer/StringDeserializer instead of ByteArraySerializer/ByteArrayDeserializer Nov 16, 2018
@lbradstreet
Copy link
Member

lbradstreet commented Nov 18, 2018

Hi, yes, we have wanted to add support for Kafka serializers for a while. Not supporting them means you have to stay outside of Kafka land, and this is obviously not ideal.

#55 isn't really a good fit for your needs - it was implemented primarily to support one of our products at the time which was an alternative implementation of a Kafka consumer. I think you'd be better off implementing the ability to supply a serializers via the consumer opts. I think supplying key.deserializer or value.deserializer props via the consumer props would be best. To do so we would need to avoid the 3 arg consumer constructor that passes in the deserialisers via the constructor. I originally thought that you could supply them via kafka/consumer-opts, but the 3 arg constructor will prevent this.

Feel free to add support for this (and a small test) and I would be very happy to accept the PR.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants