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

fix offset of single active consumer reset to 0 #336

Merged
merged 14 commits into from
Jul 22, 2024

Conversation

Darthmineboy
Copy link
Contributor

When a single active consumer with an offset is closed while no messages have been consumed, the offset 0 is sent to the server when closing the consumer gracefully and auto commit is enabled.

Recently lastStoredOffset was changed to be initialized with -1 for #306 , however that change caused this bug because the offset is only sent when lastStoredOffset < currentOffset. Because currentOffset is set to 0 by default by offset next and the default 0 initalization, lastStoredOffset < currentOffset is true when closing the consumer resulting in the offset 0 being sent. Because no messages were consumed either the offset was not populated.

pkg/stream/server_frame.go Outdated Show resolved Hide resolved
@Gsantomaggio Gsantomaggio merged commit 18547a0 into rabbitmq:main Jul 22, 2024
2 checks passed
@Gsantomaggio
Copy link
Member

Thank you

@hiimjako hiimjako added the bug Something isn't working label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants