nats-server icon indicating copy to clipboard operation
nats-server copied to clipboard

Add consumer Owner ID

Open Jarema opened this issue 1 year ago • 2 comments

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 [email protected]

Jarema avatar Mar 01 '24 13:03 Jarema

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.

bruth avatar Mar 27 '24 20:03 bruth

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.

Jarema avatar Mar 27 '24 21:03 Jarema