I am using librdkafka
C API consumer (specifically using rd_kafka_consumer_poll
to read and I did call rd_kafka_poll_set_consumer
before this)
Problem I see is that in my google test I do following
write 3 messages to kafka
init/start kafka consumer (
rd_kafka_consumer_poll
)in
rebalance_cb
I set each partition offset toRD_KAFKA_OFFSET_STORED
and assign them to handleAt this point I believe it should read 3 messages but it reads only last message but surprisingly offset for each partition is already updated!
Am I missing something here using Kafka consumer?
And one more question is I initially thought stored offset is in kafka broker and there is unique offset for topic + consumer group id + partition combination.
So I thought different consumer groups reading same topic should have different offset.
However, it doesn't look like the case. I am always reading from same offset when used different consumer groups.
I am suspecting this may be related to offset commit but not sure where to tackle this.
Any insight?