|
1970 | 1970 | / S:DELIVER content
|
1971 | 1971 | / C:GET ( S:GET-OK content / S:GET-EMPTY )
|
1972 | 1972 | / C:ACK
|
| 1973 | + / S:ACK |
1973 | 1974 | / C:REJECT
|
| 1975 | + / C:NACK |
1974 | 1976 | / C:RECOVER-ASYNC
|
1975 | 1977 | / C:RECOVER S:RECOVER-OK
|
1976 | 1978 | </doc>
|
|
2570 | 2572 |
|
2571 | 2573 | <method name = "ack" index = "80" label = "acknowledge one or more messages">
|
2572 | 2574 | <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. |
2576 | 2584 | </doc>
|
2577 | 2585 |
|
2578 | 2586 | <chassis name = "server" implement = "MUST" />
|
2579 |
| - <chassis name="client" implement="MUST"/> |
| 2587 | + <chassis name ="client" implement = "MUST"/> |
2580 | 2588 |
|
2581 | 2589 | <field name = "delivery-tag" domain = "delivery-tag" />
|
2582 | 2590 | <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
|
2583 | 2591 | <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. |
2588 | 2598 | </doc>
|
2589 | 2599 | <rule name = "exists" on-failure = "precondition-failed">
|
2590 | 2600 | <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. |
2595 | 2607 | </doc>
|
2596 | 2608 | <doc type = "scenario">
|
2597 | 2609 | TODO.
|
|
2723 | 2735 | </doc>
|
2724 | 2736 | <chassis name = "client" implement = "MUST" />
|
2725 | 2737 | </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 | + |
2726 | 2823 | </class>
|
2727 | 2824 |
|
2728 | 2825 | <!-- == TX =============================================================== -->
|
|
2849 | 2946 |
|
2850 | 2947 | <!-- == CONFIRM ========================================================== -->
|
2851 | 2948 |
|
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 | + |
2853 | 3010 | <method name="select" synchronous="1" index="10">
|
2854 | 3011 | select confirm mode (i.e. enable publisher acknowledgements)
|
2855 | 3012 | <doc>
|
|
2859 | 3016 | </doc>
|
2860 | 3017 | <chassis name="server" implement="MUST"/>
|
2861 | 3018 | <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> |
2871 | 3019 | <field name = "nowait" type = "bit">
|
2872 | 3020 | do not send a reply method
|
2873 | 3021 | <doc>
|
|
2877 | 3025 | </doc>
|
2878 | 3026 | </field>
|
2879 | 3027 | </method>
|
| 3028 | + |
2880 | 3029 | <method name="select-ok" synchronous="1" index="11">
|
2881 | 3030 | acknowledge confirm mode
|
2882 | 3031 | <doc>
|
|
0 commit comments