nats-server
nats-server copied to clipboard
Add consumer Owner ID
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]
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.
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.