Open
Description
Feature Request
Add MaxAckPendingPerSubject to consumers.
The purpose would be to define the maximum number of unacknowledged messages that can be outstanding with the same subject and suspend delivery for any messages with the same subject.
Use Case:
Using subjects as a queue for a dynamic number of state machines/actors that process messages in-order.
See Slack https://natsio.slack.com/archives/C069GSYFP/p1687911873115719
Proposed Change:
New configuration, server-side accounting for the number of in-flight messages per subject, more flow control logic, testing, and documentation.
Who Benefits From The Change(s)?
Users trying to avoid setting a fixed number of consumers.
Alternative Approaches
Set MaxAckPending, and use Deterministic Subject token Partitioning to distribute messages to a fixed number of consumers.