I have 2 consumers say c1 belonging to group g1 and c2 belonging to group g2. I have a topic testing with 100 messages. c1 has read the messages and auto commit is enabled. Now if i start c2 should it start consuming from offset 0 ? If so I am not able to consume the messages from start in a different group
Asked
Active
Viewed 1,578 times
1 Answers
1
Consumer offset is unique and controlled by the consumer.
In your scenario, as the consumers are on two different group consuming the same topic, because there is no offset stored anywhere and therefore the behaviour of new consumer will depend on the auto.offset.reset config. If it is set to smallest then the new consumer will start from the beginning of the topic (smallest) or from the end of the topic (largest).

Sudhesh Rajan
- 367
- 1
- 7
-
Consumers in different groups have their commit offsets maintained separately ryt ? – codehacker Jun 20 '17 at 10:07
-
Every consumer maintains their offset separately. Even if they are on the same group. There is a separate topic called __consumer_offset topic where you can find per partition per group of consumers committed offset. – Sudhesh Rajan Jun 20 '17 at 10:13
-
Each partition of a topic can be consumed by one and only consumer in a particular group but can be consumed by multiple consumers if they are on separate groups. – Sudhesh Rajan Jun 20 '17 at 10:16
-
I hope it answered your question – Sudhesh Rajan Jun 20 '17 at 10:37