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/ >