Kafka Consumer

The main purpose of the Kafka Consumer is to read data from a topic. The Kafka consumer fetches the messages from topic's partitions. The Kafka Consumer required Deserializer to transform bytes to object to identify key and value of messages.

If a consumer reads data from a topic's partition, data/messages comes in order way such as message 0, message 1, message 2, message 3, message 4, message 5 and so on.

If a consumer reads data from a multiple topic's partitions, there is no ordering across partitions.

  1. The main purpose of the Kafka Consumer is read data from a topic.
  2. The Kafka consumer fetches the messages from topic's partitions.
  3. The Kafka Consumer required Deserializer to transform bytes to object to identify key and value of messages.
  4. If a consumer reads data from a topic's partition, data/messages comes in order way such as message 0, message 1, message 2, message 3, message 4, message 5 and so on.
  5. If a consumer reads data from a multiple topic's partitions, there is no ordering across partitions.
  6. Example of KeyDeserializer=IntegerDeserializer.
  7. Example of ValueDeserializer=StringDeserializer.

Read this article of Create Kafka Consumer In Java


Kafka Consumer Read

Create Kafka Consumer In Java

In the next topic, you will understand about Create Kafka Cluster