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

Add consumer Owner ID #5157

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add consumer Owner ID #5157

wants to merge 1 commit into from

Conversation

Jarema
Copy link
Member

@Jarema Jarema commented Mar 1, 2024

This is an alternative approach to PR #5141

It does not use metadata, but instead introduces lightweight "ownerID" string to consumer and request.

Needs more testing. Wanted to just show the idea.

Signed-off-by: Tomasz Pietrek tomasz@nats.io

@Jarema Jarema force-pushed the add-consumer-owner-id branch 2 times, most recently from b9eb6ff to d3bae08 Compare March 1, 2024 14:01
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better for the notion of exclusive consumers, where a consumer can be configured to track AppIDs in requests and affinitize to one until it is all gone, then would switch to a new one.

@bruth
Copy link
Member

bruth commented Mar 27, 2024

My takeaway of this is that It boils down to a client holding an exclusive lock for delivery of messages while connected. Once disconnected/timed out, there is a switch.

The question is who is initiating the switch. Inbound requests from other member and the server chooses one for exclusivity vs. the application side that sends an update on this ID to define the new exclusive member.

@Jarema
Copy link
Member Author

Jarema commented Mar 27, 2024

With this (and metadata PR too), its the client setting up the Owner ID, and then when sending fetch, server will check ID sent in it. If it matches, it will fulfill the request. If not, it will send back error.

To change the ownership, client config has to be updated.

This is heavily client-side driven, which allows for nice control, however considering timing for 2.11, I think we can improve it a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants