Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka Topic And Offset

Tags:

apache-kafka

I have a question,Suppose there is a TOPIC T1 and there are two Consumer C1 and C2 belongs to two different groups and current offset is 0.We know that Kafka maintains the Offset for consumer.So if C1 consume the message and Offset becomes 1 then what will happen if C2 consume the message will it start from 1 offset or it will start consume the message from 0 offset?. Means how offset will be maintains for two different consumer Group?.

Thanks

like image 938
amitabh pandey Avatar asked Dec 12 '25 20:12

amitabh pandey


1 Answers

Kafka maintains the consumer offsets per consumer group, topic and partition, which means, if you have multiple consumers with different consumer groups on the same topic, it will maintain the offset for each group individually. So, in that case, if consumer 1 reads messages, the offset for consumer 2 will not be affected, as long as it belongs to a different consumer group.

like image 157
Jan Held Avatar answered Dec 15 '25 15:12

Jan Held



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!