Skip to content

Feature Request: Automatic Offset Refresh on Leadership Claim in SAC Mode #239

@alonrez1

Description

@alonrez1

Hello,

I’m using the rabbitmq-stream-js-client with RabbitMQ Streams in Single Active Consumer (SAC) mode. My consumers share the same consumer reference and are initialized with an offset (e.g. using Offset.first() or via a custom offset query).

Issue:
When two consumers start concurrently with no stored offset, both initialize with the same starting point. After the leader processes messages (e.g., up to offset 5) and fails, a standby is promoted. However, since the standby was initialized with a stale offset (e.g. starting at 1), it resumes from there rather than from the last committed offset + 1 (offset 6).

Request:
• Is there support or a configuration option for automatically refreshing the consumer offset upon leadership claim?
• If not, are there any recommended workarounds or plans to add this feature?
• Alternatively, could an event or callback be provided to notify a consumer when it becomes active?

Environment:
• rabbitmq-stream-js-client version: 0.5.1
• RabbitMQ Streams version: 3.11+
• Node.js version: v22.14.0

Any guidance would be appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions