Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> produce / consume json to kafka

Copy link to this message
Re: produce / consume json to kafka
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
- a little bit more complex Json encoder / decoder that handles the
serialization (byte array to object and viceversa) behind the scenes.

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.