Skip to content

Commit ab50bfb

Browse files
committed
tidy confirm docs
- make Basic.Ack more symmetric - same meaning of Basic.Ack{delivery-tag=0, multiple=1} regardless of direction (NB: this means confirm counting should start at one, not zero, but that's a separate bug) - the validity of the delivery-tag MUST be checked by the Basic.Ack recipient. - define confirmation condition more succinctly - remove "forget confirmed messages" rule since it is captured by the Basic.Ack rules.
1 parent 7145f26 commit ab50bfb

File tree

1 file changed

+36
-41
lines changed

1 file changed

+36
-41
lines changed

docs/specs/amqp0-9-1.xml

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,34 +2570,38 @@
25702570

25712571
<method name = "ack" index = "80" label = "acknowledge one or more messages">
25722572
<doc>
2573-
On the server side, this method acknowledges one or more
2574-
messages delivered via the Deliver or Get-Ok methods; the
2575-
client can ask to confirm a single message or a set of
2576-
messages up to and including a specific message.
2573+
When sent by the client, this method acknowledges one or more
2574+
messages delivered via the Deliver or Get-Ok methods.
2575+
2576+
When sent by server, this method acknowledges one or more
2577+
messages published with the Publish method on a channel in
2578+
confirm mode.
25772579

2578-
On the client side, this method acknowledges one or more
2579-
messages published to a channel in confirm mode; the client
2580-
may receive an acknowledgement for a single message or for a
2581-
set of message up to and including a specific message.
2580+
The acknowledgement can be for a single message or a set of
2581+
messages up to and including a specific message.
25822582
</doc>
25832583

25842584
<chassis name = "server" implement = "MUST" />
2585-
<chassis name="client" implement="MUST"/>
2585+
<chassis name ="client" implement = "MUST"/>
25862586

25872587
<field name = "delivery-tag" domain = "delivery-tag" />
25882588
<field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
25892589
<doc>
2590-
If set to 1, the delivery tag is treated as "up to and including", so that the
2591-
peer can acknowledge multiple messages with a single method. If set to zero,
2592-
the delivery tag refers to a single message. If the multiple field is 1, and the
2593-
delivery tag is zero, tells the server to acknowledge all outstanding messages.
2590+
If set to 1, the delivery tag is treated as "up to and
2591+
including", so that multiple messages can be acknowledged
2592+
with a single method. If set to zero, the delivery tag
2593+
refers to a single message. If the multiple field is 1, and
2594+
the delivery tag is zero, this indicates acknowledgement of
2595+
all outstanding messages.
25942596
</doc>
25952597
<rule name = "exists" on-failure = "precondition-failed">
25962598
<doc>
2597-
The server MUST validate that a non-zero delivery-tag refers to a delivered
2598-
message, and raise a channel exception if this is not the case. On a transacted
2599-
channel, this check MUST be done immediately and not delayed until a Tx.Commit.
2600-
Specifically, a client MUST not acknowledge the same message more than once.
2599+
A message MUST not be acknowledged more than once. The
2600+
receiving peer MUST validate that a non-zero delivery-tag
2601+
refers to a delivered message, and raise a channel
2602+
exception if this is not the case. On a transacted
2603+
channel, this check MUST be done immediately and not
2604+
delayed until a Tx.Commit.
26012605
</doc>
26022606
<doc type = "scenario">
26032607
TODO.
@@ -2858,24 +2862,24 @@
28582862
<class name = "confirm" handler = "channel" index = "85" label = "work with confirms">
28592863
<doc>
28602864
The Confirm class allows publishers to put the channel in
2861-
confirm mode and be notified when messages have been handled by
2862-
the broker. The intention is that all messages published on a
2863-
channel in confirm mode will be acknowledged at some point. By
2864-
acknowledging a message the broker assumes responsibility for it
2865-
and indicates that it has done something it deems reasonable
2866-
with it.
2865+
confirm mode and susequently be notified when messages have been
2866+
handled by the broker. The intention is that all messages
2867+
published on a channel in confirm mode will be acknowledged at
2868+
some point. By acknowledging a message the broker assumes
2869+
responsibility for it and indicates that it has done something
2870+
it deems reasonable with it.
28672871

28682872
Unroutable mandatory or immediate messages are acknowledged
2869-
right after the Basic.Return method. Transient messages are
2870-
acknowledged as soon as they arrive on all the queues they were
2871-
routed to. Persistent messages are acknowledged when all queues
2873+
right after the Basic.Return method. Messages are acknowledged
2874+
when all queues to which the message has been routed
28722875
have either delivered the message and received an
2873-
acknowledgement (if required), or persisted the message.
2876+
acknowledgement (if required), or enqueued the message (and
2877+
persisted it if required).
28742878

2875-
Published messages are assigned ascending sequence numbers
2876-
(starting at 0, when the Confirm.Select method is used); these
2877-
sequence numbers are later used to identify messages in
2878-
Basic.Ack methods.
2879+
Published messages are assigned ascending sequence numbers,
2880+
starting at 0 when the Confirm.Select method is used. The server
2881+
confirms messages by sending Basic.Ack methods referring to these
2882+
sequence numbers.
28792883
</doc>
28802884

28812885
<rule name = "all messages acknowledged">
@@ -2885,7 +2889,7 @@
28852889
</doc>
28862890
</rule>
28872891

2888-
<rule name = "wait for all queues">
2892+
<rule name = "all queues">
28892893
<doc>
28902894
The server MUST acknowledge a message only after it was
28912895
properly handled by all the queues it was delivered to.
@@ -2899,14 +2903,6 @@
28992903
</doc>
29002904
</rule>
29012905

2902-
<rule name = "forget confirmed messages">
2903-
<doc>
2904-
The server MUST NOT reference any messages it has already
2905-
confirmed. Thus, clients can safely forget about confirmed
2906-
messages.
2907-
</doc>
2908-
</rule>
2909-
29102906
<rule name = "time guarantees">
29112907
<doc>
29122908
No guarantees are made as to how soon a message is
@@ -2917,7 +2913,6 @@
29172913

29182914
<doc type = "grammar">
29192915
confirm = C:SELECT S:SELECT-OK
2920-
/ S:ACK
29212916
</doc>
29222917

29232918
<chassis name = "server" implement = "SHOULD" />

0 commit comments

Comments
 (0)