Kafka, mail # user - produce / consume json to kafka
produce / consume json to kafka
Oleg Ruchovets 2013-06-23, 11:08
Hi , I need to produce/consume json to/from Kafka.
Can you please point me on example how to do it. I am using java and kafka 0.7.2
Re: produce / consume json to kafka
Andrea Gazzarini 2013-06-23, 12:54
A json payload can be seen from several perspectives:
- as some kind of object (e.g. jackson JSonNode) - as a string - a byte array
Imho all depends on what "perspective" you are using.
Assuming that you are not working directly with byte arrays (in this case you could write a simple Byte array encoder / decoder) you can create
- a String encoder / decoder (I don't remember if kafka dist already has this) - a little bit more complex Json encoder / decoder that handles the serialization (byte array to object and viceversa) behind the scenes.
Best, Andrea On 23 Jun 2013 13:08, "Oleg Ruchovets" <[EMAIL PROTECTED]> wrote:
> Hi , > I need to produce/consume json to/from Kafka. > > Can you please point me on example how to do it. > I am using java and kafka 0.7.2 > > Thanks > Oleg. >
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by Sematext