How Kafka broadcast to many Consumer Groups

apache-kafka

Solution

Only one consumer in a `consumer group` can pull the message. But all `consumer groups` get the messages.

So if you want all your consumers to get the messages, assign them different `consumer groups`. Each message goes to every consumer group, but within a group, it goes to only one consumer.

Read the `Consumer` section here.

Problem

I am new to Kafka and I will appreciate very much clarification on the next case. Kafka documentation says in the paragraph "Consumer Position": "Our topic is divided into a set of totally ordered partitions, each of which is consumed by one consumer at any given time." Based on statement above if few Consumer Groups subscribed to a topic and Producer will publish message to particular partition within this topic then only one Consumer can pull the message. The question is how broadcast to many Consumer Groups could happen if only one Consumer can pull particular message?

Original source