Skip to content

Why resume the consumer before invoke the listeners? #1819

Answered by garyrussell
pengwan75 asked this question in Q&A
Discussion options

You must be logged in to vote

If the consumer is paused (at the application's request), the poll will return no records, so the listener won't be invoked, so it doesn't matter where the resume is done.

An application might pause the container (and hence the consumer before the next poll), if it is not ready to receive new records, but it wants to remain part of the consumer group and not cause a rebalance.

The listener CANNOT "take a long time" - it must be able to handle the records returned by the poll within the configured max.poll.interval.ms. Otherwise, the broker will force a rebalance.

pause/resume is simply a mechanism to remain part of the group while not actively receiving any records, but we must continue t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by garyrussell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants