Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.23 KB

kafka-exercise-using-consumer-group.md

File metadata and controls

25 lines (18 loc) · 1.23 KB

Exercise: Using Consumer Group

In this exercise you will create a consumer group and observe what happens when the number of members changes.

Duration: 30 mins

TIP Use bit.ly/kafka-exercise-admin-06 to access this exercise.

Procedure

  1. (optional) Install kafkacat - Apache Kafka producer and consumer tool
  1. Create a topic t1 with 3 partitions
  2. Start a new consumer c1 in a consumer group CG1
  3. Send messages to partition 0 and use 0 for the key
  4. Send messages to partition 2 and use 2 for the key

At this point you should have 3 partitions, 2 producers and 1 consumer. Observe what and how messages are consumed. Simply send messages so you can identity what message used what partition.

  1. Start a new consumer c2 in the CG1 consumer group
  2. Observe what messages are consumed by the consumers
  3. Start a new consumer c3 in the CG1 consumer group
  4. Observe what messages are consumed by the consumers
  5. Shut down any of the running consumers
  6. Observe which consumer takes over the partition