0

I got this doubt from this question.

When I am not using Kafka Streams, Why do I need to use Serializer while creating ZkClient?

Community
  • 1
  • 1
Gibbs
  • 21,904
  • 13
  • 74
  • 138

1 Answers1

0

Kafka havily uses zookeeper for storing metadata (topics). For that library com.101tec::zkClient is used. According to source code ZkClient it requires ZkSerializer for serializing/deserializing data send/retreived from zookeeper. Kafka inside itself has implementation of ZkSerializer: ZKStringSerializer (defied in zkUtils).

However, for usual interaction with kafka (producing / consuming) you do not need to create ZkClient. It is required only for 'administrative' work.

Natalia
  • 4,362
  • 24
  • 25
  • Thanks for your answer. Please read the top voted comment in the link I posted. If we don't specify Serializer while creating topic, it is not actually created by Kafka. What does it mean? It is what confused me. – Gibbs Apr 06 '17 at 06:36
  • @GopsAB i will assume that it is connected the way how your topic name is serialized and written in zookeeper. When you display the list of topics - it is just list of all nodes in zookeeper. While kafka can treat it as invalid topic name – Natalia Apr 06 '17 at 14:17