Skip to content

Conversation

@MauriceVanVeen
Copy link
Member

Implements durable stream sourcing/mirroring as described in this ADR: nats-io/nats-architecture-and-design#389. Built on top of the consumer reset API: #7489.

A durable push consumer can be created with AckPolicy: AckFlowControl and a value for Heartbeat, to be used for stream sourcing and mirroring as an alternative for the current ephemeral consumer. Messages will be acknowledged automatically by the receiving end based on flow control, or triggered by the heartbeat. Additionally, MaxAckPending specifies the upper bound for pending messages, if this is reached a flow control message will also be sent, if not already, to acknowledge messages.

AckPolicy: AckFlowControl is special in that it only allows for infinite retries for MaxDeliver and has no AckWait or BackOff. Messages are meant to reliably flow from one place to the other, the heartbeat somewhat functions like AckWait but acknowledgements may happen either earlier or later depending on how many messages are sent, how large they are (larger means flow control happens sooner), or when MaxAckPending is hit.

Importantly, this durable consumer can reliably source and mirror messages from Interest and WorkQueue retention streams, whereas this is not fully reliable with the current ephemeral consumer approach.

Resolves #4109

Signed-off-by: Maurice van Veen [email protected]

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.

2 participants