From 319370bc258e70c40d389ee9e04a7132a8c8bf75 Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Thu, 2 Apr 2020 13:25:36 -0400 Subject: [PATCH] Including an example of ack wait Signed-off-by: Matthias Hanel --- developing-with-nats-streaming/acks.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/developing-with-nats-streaming/acks.md b/developing-with-nats-streaming/acks.md index 92b1968..10907fe 100644 --- a/developing-with-nats-streaming/acks.md +++ b/developing-with-nats-streaming/acks.md @@ -16,6 +16,15 @@ sub, err := sc.Subscribe("foo", }, stan.SetManualAckMode(), stan.AckWait(aw)) ``` +> Note that if processing a particular message exceeds ack wait, the following behavior can be observed with [queue subscriptions](queues.md): +> 1. Subscriber A receives the message. +> 2. Subscriber A exceeds ack wait time and Subscriber B receives the message. +> 3. Subscriber B exceeds ack wait time and Subscriber C receives the message. +> 6. Subscriber A finishes processing and acknowledges the message. +> 7. Re-delivery of the message ceases. +> +> How often the message is re-delivered depends on processing time for the message and available subscriber. + ## Max In Flight Subscribers can set max in flight to rate limit incoming messages. The server will send at most “max in flight” messages before receiving an acknowledgement. Setting max in flight to 1 insures every message is processed in order.