Consumer
Congratulations, you're a rock star ! Let's finally learn how to consume from a topic and particular partition.
What is the Consumer?
The consumer is the other side of the road, where services and applications can subscribe to a Topic and start consuming messages from them.
Few characteristics about the consumers:
It works with subscription against 1+ topic
It use a pull request method against the brokers
Keeps a record of the offset that it reads from
Responsible for the offset commit
It attach itself to a Consumer Group
Now let's see how we can consume the messages we have been producing from the other side.
But, before that take a look to the kafka-console-consumer.sh
script and its options. Looking at the usage scripts is helpful and save you a lot of time when you are starting to play with it.
Consume messages
Use the Kafka console consumer to Consume from the topic you send messages to in the previous section.
Initially you can consume messages as simply as:
Last updated