Skip to content

Commit add636d

Browse files
author
Marek Majkowski
committed
bug23646 merged into default
2 parents 731a133 + 610e05c commit add636d

File tree

17 files changed

+341
-230
lines changed

17 files changed

+341
-230
lines changed

docs/specs/amqp0-8.stripped.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -684,19 +684,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
684684
<chassis name="client" implement="MUST"/>
685685
</method>
686686
</class>
687-
<class name="confirm" handler="channel" index="85">
688-
<method name="select" synchronous="1" index="10">
689-
<chassis name="server" implement="MUST"/>
690-
<response name="select-ok"/>
691-
<field name = "multiple" type = "bit">
692-
</field>
693-
<field name = "nowait" type = "bit">
694-
</field>
695-
</method>
696-
<method name="select-ok" synchronous="1" index="11">
697-
<chassis name="client" implement="MUST"/>
698-
</method>
699-
</class>
700687
<class name="tunnel" handler="tunnel" index="110">
701688
<chassis name="server" implement="MAY"/>
702689
<chassis name="client" implement="MAY"/>

docs/specs/amqp0-8.xml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,43 +3684,6 @@ confirm transaction mode
36843684
<chassis name="client" implement="MUST"/>
36853685
</method>
36863686
</class>
3687-
<class name="confirm" handler="channel" index="85">
3688-
<method name="select" synchronous="1" index="10">
3689-
select confirm mode (i.e. enable publisher acknowledgements)
3690-
<doc>
3691-
This method sets the channel to use publisher acknowledgements.
3692-
The client can only use this method on a non-transactional
3693-
channel.
3694-
</doc>
3695-
<chassis name="server" implement="MUST"/>
3696-
<response name="select-ok"/>
3697-
<field name = "multiple" type = "bit">
3698-
acknowledge multiple messages
3699-
<doc>
3700-
If set to 1, the delivery tag in the returned acks is
3701-
treated as "up to and including", so that the server can
3702-
acknowledge multiple messages with a single method. If set
3703-
to zero, the delivery tag refers to a single message.
3704-
</doc>
3705-
</field>
3706-
<field name = "nowait" type = "bit">
3707-
do not send a reply method
3708-
<doc>
3709-
If set, the server will not respond to the method. The client should
3710-
not wait for a reply method. If the server could not complete the
3711-
method it will raise a channel or connection exception.
3712-
</doc>
3713-
</field>
3714-
</method>
3715-
<method name="select-ok" synchronous="1" index="11">
3716-
acknowledge confirm mode
3717-
<doc>
3718-
This method confirms to the client that the channel was successfully
3719-
set to use publisher acknowledgements.
3720-
</doc>
3721-
<chassis name="client" implement="MUST"/>
3722-
</method>
3723-
</class>
37243687
<class name="tunnel" handler="tunnel" index="110">
37253688
<!--
37263689
======================================================

docs/specs/amqp0-9-1.stripped.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
458458
<method name="recover-ok" synchronous="1" index="111">
459459
<chassis name="client" implement="MUST"/>
460460
</method>
461+
<method name="nack" index="120">
462+
<chassis name="server" implement="MUST"/>
463+
<field name="delivery-tag" domain="delivery-tag"/>
464+
<field name="multiple" domain="bit"/>
465+
<field name="requeue" domain="bit"/>
466+
</method>
461467
</class>
462468
<class name="tx" handler="channel" index="90">
463469
<chassis name="server" implement="SHOULD"/>
@@ -488,8 +494,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
488494
<method name="select" synchronous="1" index="10">
489495
<chassis name="server" implement="MUST"/>
490496
<response name="select-ok"/>
491-
<field name = "multiple" type = "bit">
492-
</field>
493497
<field name = "nowait" type = "bit">
494498
</field>
495499
</method>

docs/specs/amqp0-9-1.xml

Lines changed: 171 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,9 @@
19701970
/ S:DELIVER content
19711971
/ C:GET ( S:GET-OK content / S:GET-EMPTY )
19721972
/ C:ACK
1973+
/ S:ACK
19731974
/ C:REJECT
1975+
/ C:NACK
19741976
/ C:RECOVER-ASYNC
19751977
/ C:RECOVER S:RECOVER-OK
19761978
</doc>
@@ -2570,28 +2572,38 @@
25702572

25712573
<method name = "ack" index = "80" label = "acknowledge one or more messages">
25722574
<doc>
2573-
This method acknowledges one or more messages delivered via the Deliver or Get-Ok
2574-
methods. The client can ask to confirm a single message or a set of messages up to
2575-
and including a specific message.
2575+
When sent by the client, this method acknowledges one or more
2576+
messages delivered via the Deliver or Get-Ok methods.
2577+
2578+
When sent by server, this method acknowledges one or more
2579+
messages published with the Publish method on a channel in
2580+
confirm mode.
2581+
2582+
The acknowledgement can be for a single message or a set of
2583+
messages up to and including a specific message.
25762584
</doc>
25772585

25782586
<chassis name = "server" implement = "MUST" />
2579-
<chassis name="client" implement="MUST"/>
2587+
<chassis name ="client" implement = "MUST"/>
25802588

25812589
<field name = "delivery-tag" domain = "delivery-tag" />
25822590
<field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
25832591
<doc>
2584-
If set to 1, the delivery tag is treated as "up to and including", so that the
2585-
client can acknowledge multiple messages with a single method. If set to zero,
2586-
the delivery tag refers to a single message. If the multiple field is 1, and the
2587-
delivery tag is zero, tells the server to acknowledge all outstanding messages.
2592+
If set to 1, the delivery tag is treated as "up to and
2593+
including", so that multiple messages can be acknowledged
2594+
with a single method. If set to zero, the delivery tag
2595+
refers to a single message. If the multiple field is 1, and
2596+
the delivery tag is zero, this indicates acknowledgement of
2597+
all outstanding messages.
25882598
</doc>
25892599
<rule name = "exists" on-failure = "precondition-failed">
25902600
<doc>
2591-
The server MUST validate that a non-zero delivery-tag refers to a delivered
2592-
message, and raise a channel exception if this is not the case. On a transacted
2593-
channel, this check MUST be done immediately and not delayed until a Tx.Commit.
2594-
Specifically, a client MUST not acknowledge the same message more than once.
2601+
A message MUST not be acknowledged more than once. The
2602+
receiving peer MUST validate that a non-zero delivery-tag
2603+
refers to a delivered message, and raise a channel
2604+
exception if this is not the case. On a transacted
2605+
channel, this check MUST be done immediately and not
2606+
delayed until a Tx.Commit.
25952607
</doc>
25962608
<doc type = "scenario">
25972609
TODO.
@@ -2723,6 +2735,91 @@
27232735
</doc>
27242736
<chassis name = "client" implement = "MUST" />
27252737
</method>
2738+
2739+
<method name = "nack" index = "120" label = "reject one or more incoming messages">
2740+
<doc>
2741+
This method allows a client to reject one or more incoming messages. It can be
2742+
used to interrupt and cancel large incoming messages, or return untreatable
2743+
messages to their original queue.
2744+
</doc>
2745+
2746+
<rule name = "01">
2747+
<doc>
2748+
The server SHOULD be capable of accepting and processing the Nack method while
2749+
sending message content with a Deliver or Get-Ok method. I.e. the server should
2750+
read and process incoming methods while sending output frames. To cancel a
2751+
partially-send content, the server sends a content body frame of size 1 (i.e.
2752+
with no data except the frame-end octet).
2753+
</doc>
2754+
</rule>
2755+
2756+
<rule name = "02">
2757+
<doc>
2758+
The server SHOULD interpret this method as meaning that the client is unable to
2759+
process the message at this time.
2760+
</doc>
2761+
<doc type = "scenario">
2762+
TODO.
2763+
</doc>
2764+
</rule>
2765+
2766+
<rule name = "03">
2767+
<doc>
2768+
The client MUST NOT use this method as a means of selecting messages to process.
2769+
</doc>
2770+
<doc type = "scenario">
2771+
TODO.
2772+
</doc>
2773+
</rule>
2774+
2775+
<chassis name = "server" implement = "MUST" />
2776+
2777+
<field name = "delivery-tag" domain = "delivery-tag" />
2778+
2779+
<field name = "multiple" domain = "bit" label = "reject multiple messages">
2780+
<doc>
2781+
If set to 1, the delivery tag is treated as "up to and
2782+
including", so that multiple messages can be rejected
2783+
with a single method. If set to zero, the delivery tag
2784+
refers to a single message. If the multiple field is 1, and
2785+
the delivery tag is zero, this indicates rejection of
2786+
all outstanding messages.
2787+
</doc>
2788+
<rule name = "exists" on-failure = "precondition-failed">
2789+
<doc>
2790+
A message MUST not be rejected more than once. The
2791+
receiving peer MUST validate that a non-zero delivery-tag
2792+
refers to an unacknowledged, delivered message, and
2793+
raise a channel exception if this is not the case.
2794+
</doc>
2795+
<doc type = "scenario">
2796+
TODO.
2797+
</doc>
2798+
</rule>
2799+
</field>
2800+
2801+
<field name = "requeue" domain = "bit" label = "requeue the message">
2802+
<doc>
2803+
If requeue is true, the server will attempt to requeue the message. If requeue
2804+
is false or the requeue attempt fails the messages are discarded or dead-lettered.
2805+
</doc>
2806+
2807+
<rule name = "01">
2808+
<doc>
2809+
The server MUST NOT deliver the message to the same client within the
2810+
context of the current channel. The recommended strategy is to attempt to
2811+
deliver the message to an alternative consumer, and if that is not possible,
2812+
to move the message to a dead-letter queue. The server MAY use more
2813+
sophisticated tracking to hold the message on the queue and redeliver it to
2814+
the same client at a later stage.
2815+
</doc>
2816+
<doc type = "scenario">
2817+
TODO.
2818+
</doc>
2819+
</rule>
2820+
</field>
2821+
</method>
2822+
27262823
</class>
27272824

27282825
<!-- == TX =============================================================== -->
@@ -2849,7 +2946,67 @@
28492946

28502947
<!-- == CONFIRM ========================================================== -->
28512948

2852-
<class name="confirm" handler="channel" index="85">
2949+
<class name = "confirm" handler = "channel" index = "85" label = "work with confirms">
2950+
<doc>
2951+
The Confirm class allows publishers to put the channel in
2952+
confirm mode and susequently be notified when messages have been
2953+
handled by the broker. The intention is that all messages
2954+
published on a channel in confirm mode will be acknowledged at
2955+
some point. By acknowledging a message the broker assumes
2956+
responsibility for it and indicates that it has done something
2957+
it deems reasonable with it.
2958+
2959+
Unroutable mandatory or immediate messages are acknowledged
2960+
right after the Basic.Return method. Messages are acknowledged
2961+
when all queues to which the message has been routed
2962+
have either delivered the message and received an
2963+
acknowledgement (if required), or enqueued the message (and
2964+
persisted it if required).
2965+
2966+
Published messages are assigned ascending sequence numbers,
2967+
starting at 1 with the first Confirm.Select method. The server
2968+
confirms messages by sending Basic.Ack methods referring to these
2969+
sequence numbers.
2970+
</doc>
2971+
2972+
<rule name = "all messages acknowledged">
2973+
<doc>
2974+
The server MUST acknowledge all messages received after the
2975+
channel was put into confirm mode.
2976+
</doc>
2977+
</rule>
2978+
2979+
<rule name = "all queues">
2980+
<doc>
2981+
The server MUST acknowledge a message only after it was
2982+
properly handled by all the queues it was delivered to.
2983+
</doc>
2984+
</rule>
2985+
2986+
<rule name = "unroutable messages">
2987+
<doc>
2988+
The server MUST acknowledge an unroutable mandatory or
2989+
immediate message only after it sends the Basic.Return.
2990+
</doc>
2991+
</rule>
2992+
2993+
<rule name = "time guarantees">
2994+
<doc>
2995+
No guarantees are made as to how soon a message is
2996+
acknowledged. Applications SHOULD NOT make assumptions about
2997+
this.
2998+
</doc>
2999+
</rule>
3000+
3001+
<doc type = "grammar">
3002+
confirm = C:SELECT S:SELECT-OK
3003+
</doc>
3004+
3005+
<chassis name = "server" implement = "SHOULD" />
3006+
<chassis name = "client" implement = "MAY" />
3007+
3008+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3009+
28533010
<method name="select" synchronous="1" index="10">
28543011
select confirm mode (i.e. enable publisher acknowledgements)
28553012
<doc>
@@ -2859,15 +3016,6 @@
28593016
</doc>
28603017
<chassis name="server" implement="MUST"/>
28613018
<response name="select-ok"/>
2862-
<field name = "multiple" type = "bit">
2863-
acknowledge multiple messages
2864-
<doc>
2865-
If set to 1, the delivery tag in the returned acks is
2866-
treated as "up to and including", so that the server can
2867-
acknowledge multiple messages with a single method. If set
2868-
to zero, the delivery tag refers to a single message.
2869-
</doc>
2870-
</field>
28713019
<field name = "nowait" type = "bit">
28723020
do not send a reply method
28733021
<doc>
@@ -2877,6 +3025,7 @@
28773025
</doc>
28783026
</field>
28793027
</method>
3028+
28803029
<method name="select-ok" synchronous="1" index="11">
28813030
acknowledge confirm mode
28823031
<doc>

docs/specs/amqp0-9.stripped.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -716,19 +716,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
716716
<chassis name="client" implement="MUST"/>
717717
</method>
718718
</class>
719-
<class name="confirm" handler="channel" index="85">
720-
<method name="select" synchronous="1" index="10">
721-
<chassis name="server" implement="MUST"/>
722-
<response name="select-ok"/>
723-
<field name = "multiple" type = "bit">
724-
</field>
725-
<field name = "nowait" type = "bit">
726-
</field>
727-
</method>
728-
<method name="select-ok" synchronous="1" index="11">
729-
<chassis name="client" implement="MUST"/>
730-
</method>
731-
</class>
732719
<class name="tunnel" handler="tunnel" index="110">
733720
<chassis name="server" implement="MAY"/>
734721
<chassis name="client" implement="MAY"/>

docs/specs/amqp0-9.xml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4384,44 +4384,6 @@
43844384
</method>
43854385
</class>
43864386

4387-
<class name="confirm" handler="channel" index="85">
4388-
<method name="select" synchronous="1" index="10">
4389-
select confirm mode (i.e. enable publisher acknowledgements)
4390-
<doc>
4391-
This method sets the channel to use publisher acknowledgements.
4392-
The client can only use this method on a non-transactional
4393-
channel.
4394-
</doc>
4395-
<chassis name="server" implement="MUST"/>
4396-
<response name="select-ok"/>
4397-
<field name = "multiple" type = "bit">
4398-
acknowledge multiple messages
4399-
<doc>
4400-
If set to 1, the delivery tag in the returned acks is
4401-
treated as "up to and including", so that the server can
4402-
acknowledge multiple messages with a single method. If set
4403-
to zero, the delivery tag refers to a single message.
4404-
</doc>
4405-
</field>
4406-
<field name = "nowait" type = "bit">
4407-
do not send a reply method
4408-
<doc>
4409-
If set, the server will not respond to the method. The client should
4410-
not wait for a reply method. If the server could not complete the
4411-
method it will raise a channel or connection exception.
4412-
</doc>
4413-
</field>
4414-
</method>
4415-
<method name="select-ok" synchronous="1" index="11">
4416-
acknowledge confirm mode
4417-
<doc>
4418-
This method confirms to the client that the channel was successfully
4419-
set to use publisher acknowledgements.
4420-
</doc>
4421-
<chassis name="client" implement="MUST"/>
4422-
</method>
4423-
</class>
4424-
44254387
<!-- == TUNNEL =========================================================== -->
44264388

44274389
<class name = "tunnel" handler = "tunnel" index = "110" label = "methods for protocol tunnelling">

0 commit comments

Comments
 (0)