What is the best way for this? Do we need to have common serializer/deserializer for all type of the objects we publish? OR seperate for each objects? If we have seperate serializer/deserializers, then how can I configure kafka? Or Is it recommended to use Avro schemas?
Thanks On 2 May 2016 at 18:43, Gerard Klijs <gerard.kl...@dizzit.com> wrote: > I think by design it would be better to put different kind of messages in a > different topic. But if you would want to mix you can make your own > serializer/deserializer you could append a 'magic byte' to the byes you get > after you serialize, to be able to deserialize using the correct methods. > The custom serializer would always return an Object, which you could cast > when needed in the poll loop of the consumer. I think this is de > cleanest/best way, but maybe someone has a different idea? > > On Mon, May 2, 2016 at 7:54 AM Ratha v <vijayara...@gmail.com> wrote: > > > Hi all; > > > > Say, I publish and consume different type of java objects.For each I have > > to define own serializer implementations. How can we provide all > > implementations in the kafka consumer/producer properties file under the > > "serializer.class" property? > > > > > > -- > > -Ratha > > http://vvratha.blogspot.com/ > > > -- -Ratha http://vvratha.blogspot.com/