You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Ratha v <vi...@gmail.com> on 2016/04/13 01:59:54 UTC

What is the best way to publish and consume different type of messages?

Hi all;
Im using kafka 0.0.8V.

I want to publish /consume byte[] objects, java bean objects, serializable
objects and much more..

What is the best way to define a publisher and consumer for this type
scenario?
When I consume a message from the consumer iterator, I do not know what
type of the message it is.
Can anybody point me a guide on how to design such scenarios?

Thanks.

-- 
-Ratha
http://vvratha.blogspot.com/

RE: What is the best way to publish and consume different type of messages?

Posted by "Tauzell, Dave" <Da...@surescripts.com>.
I suggest creating your own wrapper object to hold the data.  When using java serialized objects you'll need to take care of backwards compatibility. While this issue exists no matter what format you use, it is easy to make a new version of a java object and not think about if it is compatible.

-Dave

Dave Tauzell | Senior Software Engineer | Surescripts
O: 651.855.3042 | www.surescripts.com |   Dave.Tauzell@surescripts.com
Connect with us: Twitter I LinkedIn I Facebook I YouTube


-----Original Message-----
From: Ratha v [mailto:vijayaratha@gmail.com]
Sent: Tuesday, April 12, 2016 7:00 PM
To: users@kafka.apache.org
Subject: What is the best way to publish and consume different type of messages?

Hi all;
Im using kafka 0.0.8V.

I want to publish /consume byte[] objects, java bean objects, serializable objects and much more..

What is the best way to define a publisher and consumer for this type scenario?
When I consume a message from the consumer iterator, I do not know what type of the message it is.
Can anybody point me a guide on how to design such scenarios?

Thanks.

--
-Ratha
http://vvratha.blogspot.com/
This e-mail and any files transmitted with it are confidential, may contain sensitive information, and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender by reply e-mail immediately and destroy all copies of the e-mail and any attachments.