0

We are using Springboot Kafkalistner annotation to listen to a Kafka topic. In the consumer config, i have set ack mode to COUNT_TIME with the ackCount at 2000 and ackTime to 1 minute and the listener is polling for 100 messages at a time (max.poll.records=100). I have created this config to handle more time for the batch of listeners to process and the 1 minute to handle any scenario when the count is not met so we don't end up waiting forever.

With this, I published about 500K messages to this topic. My expectation was that the offset commit to happen every 2000 messages consumed and the messagesBehind count for the consumer group to go down in decrements of 2000. However, I see the messages behind stay very high and they went down from 500K to 380K to 250K to 125K to 0. I did not see any intermediate counts. Does that mean the offsets are not happening on every 2000 messages and instead happening only for around 100K messages at a time? Is this expected? What would be the impact on this to the broker, if any? how do we address this?

Thank you

6
  • You look at "Messages Behind" in Kafka UI, ain't you? Commented Aug 21 at 15:29
  • yes thats where i was seeing these high #s Commented Aug 21 at 15:49
  • Why don't you look at & track actual offsets you're processing at your consumer side? Then you'd have an actual picture instead of relying on god-knows-how refreshed number at some obscure UI. Commented Aug 21 at 16:00
  • how can i do that? do you suggest looking at the consumer offsets topic? Commented Aug 21 at 18:52
  • No, I'm suggesting implement/turn on these metrics ON your consumer, and then observe it through logs/metrics endpoints/observability systems you use Commented Aug 21 at 20:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.