Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Documentation about Acknowledgment.nack() #2906

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

powibol
Copy link
Contributor

@powibol powibol commented Nov 17, 2023

From the current documentation, it was not clear to me what is the effect of calling Acknowledgment.nack() when a listener is assigned to multiple topics and/or partitions.

Looking at the implementation, I believe that calling nack(Duration sleep) will pause the entire listener for the specified sleep duration. Another option would have been that is only pauses reading from one partition or one topic, which other topics or partitions are still processed.

With this PR, I attempt to make this more clear on the documentation page and in the JavaDoc of Acknowledgment.nack().

Please feel free to discuss, improve and correct me in case I'm wrong. Thank you!

@garyrussell
Copy link
Contributor

This behavior is as-designed. Typically, nack() is used for transient errors (e.g. DB is down), in which case processing records from other partitions won't work either. Adding partition-level nacks would add quite a bit of complexity to an already complex component.

@garyrussell garyrussell merged commit 1082614 into spring-projects:main Nov 20, 2023
1 check passed
@garyrussell garyrussell added this to the 3.1.0 milestone Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants