Skip to content

Fix handling and storing offset by timestamp #392

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

Conversation

yurahaid
Copy link
Contributor

@yurahaid yurahaid commented May 6, 2025

Problem:

Sometimes the timestamp value can be written as an offset in rabbitmq, which freezes message consumption.

Real case: You add a new consumer to an existing stream for which the offset is not yet set. You do not want to reread all messages, so you specify -1 min. If there are no messages for a certain time and automatic flush is triggered, this timestamp value will be written as the offset.

As a summary, based on the code in the library and the stream protocol, it looks like the method consumer.setCurrentOffset should only be called with a typeOffset value.

Problem:

Sometimes the timestamp value can be written as an offset in rabbitmq, which freezes message consumption
Real case: You add a new consumer to an existing stream for which the offset is not yet set, and you do not want to reread all messages, so you specify -1 min. If there are no messages for a certain time and automatic flush is triggered, this timestamp value will be written as the offset.
@Gsantomaggio
Copy link
Member

@yurahaid Thank you for the PR we will check it as soon as possible.

@hiimjako wdyt?

@hiimjako hiimjako added the bug Something isn't working label May 6, 2025
@hiimjako
Copy link
Collaborator

hiimjako commented May 6, 2025

It makes sense to me, it was clearly a bug.

@Gsantomaggio Gsantomaggio merged commit 585930f into rabbitmq:main May 7, 2025
2 checks passed
@Gsantomaggio
Copy link
Member

Thank you @yurahaid

@Gsantomaggio Gsantomaggio added this to the 1.5.4 milestone May 7, 2025
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