How do I use multiple consumers in Kafka?

后端 未结 3 907
再見小時候
再見小時候 2021-01-31 16:21

I am a new student studying Kafka and I\'ve run into some fundamental issues with understanding multiple consumers that articles, documentations, etc. have not been too helpful

3条回答
  •  囚心锁ツ
    2021-01-31 16:43

    If you want multiple consumers to consume same messages (like a broadcast), you can spawn them with different consumer group and also setting auto.offset.reset to smallest in consumer config. If you want multiple consumers to finish consuming in parallel ( divide the work among them ), you should create number of partitions >= number of consumers. One partition can be only consumed by at most one consumer process. But One consumer can consume more than one partitions.

提交回复
热议问题