6 (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
7 iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
8 TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
12 JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
13 Corporation, IONA Technologies, Red Hat, Inc., TWIST Process Innovations, and
14 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
15 perpetual, royalty-free, nontransferable, nonexclusive license to
16 (i) copy, display, distribute and implement the Advanced Messaging Queue Protocol
17 ("AMQP") Specification and (ii) the Licensed Claims that are held by
18 the Authors, all for the purpose of implementing the Advanced Messaging
19 Queue Protocol Specification. Your license and any rights under this
20 Agreement will terminate immediately without notice from
21 any Author if you bring any claim, suit, demand, or action related to
22 the Advanced Messaging Queue Protocol Specification against any Author.
23 Upon termination, you shall destroy all copies of the Advanced Messaging
24 Queue Protocol Specification in your possession or control.
26 As used hereunder, "Licensed Claims" means those claims of a patent or
27 patent application, throughout the world, excluding design patents and
28 design registrations, owned or controlled, or that can be sublicensed
29 without fee and in compliance with the requirements of this
30 Agreement, by an Author or its affiliates now or at any
31 future time and which would necessarily be infringed by implementation
32 of the Advanced Messaging Queue Protocol Specification. A claim is
33 necessarily infringed hereunder only when it is not possible to avoid
34 infringing it because there is no plausible non-infringing alternative
35 for implementing the required portions of the Advanced Messaging Queue
36 Protocol Specification. Notwithstanding the foregoing, Licensed Claims
37 shall not include any claims other than as set forth above even if
38 contained in the same patent as Licensed Claims; or that read solely
39 on any implementations of any portion of the Advanced Messaging Queue
40 Protocol Specification that are not required by the Advanced Messaging
41 Queue Protocol Specification, or that, if licensed, would require a
42 payment of royalties by the licensor to unaffiliated third parties.
43 Moreover, Licensed Claims shall not include (i) any enabling technologies
44 that may be necessary to make or use any Licensed Product but are not
45 themselves expressly set forth in the Advanced Messaging Queue Protocol
46 Specification (e.g., semiconductor manufacturing technology, compiler
47 technology, object oriented technology, networking technology, operating
48 system technology, and the like); or (ii) the implementation of other
49 published standards developed elsewhere and merely referred to in the
50 body of the Advanced Messaging Queue Protocol Specification, or
51 (iii) any Licensed Product and any combinations thereof the purpose or
52 function of which is not required for compliance with the Advanced
53 Messaging Queue Protocol Specification. For purposes of this definition,
54 the Advanced Messaging Queue Protocol Specification shall be deemed to
55 include both architectural and interconnection requirements essential
56 for interoperability and may also include supporting source code artifacts
57 where such architectural, interconnection requirements and source code
58 artifacts are expressly identified as being required or documentation to
59 achieve compliance with the Advanced Messaging Queue Protocol Specification.
61 As used hereunder, "Licensed Products" means only those specific portions
62 of products (hardware, software or combinations thereof) that implement
63 and are compliant with all relevant portions of the Advanced Messaging
64 Queue Protocol Specification.
66 The following disclaimers, which you hereby also acknowledge as to any
67 use you may make of the Advanced Messaging Queue Protocol Specification:
69 THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
70 AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
71 IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
72 FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
73 CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
74 SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
75 MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
76 PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
78 THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
79 INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
80 USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
81 PROTOCOL SPECIFICATION.
83 The name and trademarks of the Authors may NOT be used in any manner,
84 including advertising or publicity pertaining to the Advanced Messaging
85 Queue Protocol Specification or its contents without specific, written
86 prior permission. Title to copyright in the Advanced Messaging Queue
87 Protocol Specification will at all times remain with the Authors.
89 No other rights are granted by implication, estoppel or otherwise.
91 Upon termination of your license or rights under this Agreement, you
92 shall destroy all copies of the Advanced Messaging Queue Protocol
93 Specification in your possession or control.
97 "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
98 Octagon Symbol are trademarks of JPMorgan Chase & Co.
100 IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
102 IONA, IONA Technologies, and the IONA logos are trademarks of IONA
103 Technologies PLC and/or its subsidiaries.
105 LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
106 trademarks of Red Hat, Inc. in the US and other countries.
108 Java, all Java-based trademarks and OpenOffice.org are trademarks of
109 Sun Microsystems, Inc. in the United States, other countries, or both.
111 Other company, product, or service names may be trademarks or service
114 Links to full AMQP specification:
115 =================================
116 http://www.envoytech.org/spec/amq/
117 http://www.iona.com/opensource/amqp/
118 http://www.redhat.com/solutions/specifications/amqp/
119 http://www.twiststandards.org/tiki-index.php?page=AMQ
120 http://www.imatix.com/amqp
125 ========================================================
126 EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
127 (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
129 NOTE: These editors have been assigned by the AMQP working group. Please do not
130 edit/commit this file without consulting with one of the above editors.
131 ========================================================
134 2006-06-07 (PH) - version number changed to 0.8 to conform to public
135 release documentation.
137 2006-05-15 (PH) - fixed comments on queue name in basic.get to clarify
138 use of current queue in this method.
140 2006-05-15 (PH) - fixed comments on routing key in queue.bind to clarify
141 how routing key is filled when empty (to allow asynch queue.declare).
143 2006-05-11 (PH) - reset version to 0.70 so that putatitive standards
144 group can release 2-3 major new versions before hitting 1.0 (again).
146 2006-05-11 (PH) - TODO in documentation: cycle field in frame header
149 2006-05-11 (PH) - added nowait option to exchange.declare, delete,
150 queue.declare, delete, bind, purge, basic.consume, cancel,
151 file.consume, cancel, stream.consume and cancel methods.
153 2006-05-11 (PH) - removed notnull rule and added explanations on queue
154 name in queue.bind, purge, delete, basic.consume, cancel, file.consume,
155 cancel, stream.consume and cancel methods.
157 2006-05-11 (PH) - added basic.qos, file.qos, and stream.qos methods that
158 regroup all prefetch options from the consume methods. Also removed the
159 prefetch option from channel.open.
161 2006-05-11 (PH) - renumbered method indexes to show request-response
162 nature of methods; requests are 10, 20, 30 while responses are 11, 21,
165 2006-05-11 (PH) - removed OpenAMQ extension methods from this definition
166 since these are maintained seperately.
168 2006-05-26 (RG) - added Basic.Recover method to allow replay of
169 unacknowledged messages on a channel.
171 2006-07-03 (PH) - cosmetic clean-up of Basic.Recover comments.
174 <amqp major="8" minor="0" port="5672" comment="AMQ protocol 0.80">
178 ======================================================
180 ======================================================
182 <constant name="frame method" value="1"/>
183 <constant name="frame header" value="2"/>
184 <constant name="frame body" value="3"/>
185 <constant name="frame oob method" value="4"/>
186 <constant name="frame oob header" value="5"/>
187 <constant name="frame oob body" value="6"/>
188 <constant name="frame trace" value="7"/>
189 <constant name="frame heartbeat" value="8"/>
190 <constant name="frame min size" value="4096"/>
191 <constant name="frame end" value="206"/>
192 <constant name="reply success" value="200">
193 Indicates that the method completed successfully. This reply code is
194 reserved for future use - the current protocol design does not use
195 positive confirmation and reply codes are sent only in case of an
198 <constant name="not delivered" value="310" class="soft error">
199 The client asked for a specific message that is no longer available.
200 The message was delivered to another client, or was purged from the
201 queue for some other reason.
203 <constant name="content too large" value="311" class="soft error">
204 The client attempted to transfer content larger than the server
205 could accept at the present time. The client may retry at a later
208 <constant name="connection forced" value="320" class="hard error">
209 An operator intervened to close the connection for some reason.
210 The client may retry at some later date.
212 <constant name="invalid path" value="402" class="hard error">
213 The client tried to work with an unknown virtual host or cluster.
215 <constant name="access refused" value="403" class="soft error">
216 The client attempted to work with a server entity to which it has
217 no due to security settings.
219 <constant name="not found" value="404" class="soft error">
220 The client attempted to work with a server entity that does not exist.
222 <constant name="resource locked" value="405" class="soft error">
223 The client attempted to work with a server entity to which it has
224 no access because another client is working with it.
226 <constant name="frame error" value="501" class="hard error">
227 The client sent a malformed frame that the server could not decode.
228 This strongly implies a programming error in the client.
230 <constant name="syntax error" value="502" class="hard error">
231 The client sent a frame that contained illegal values for one or more
232 fields. This strongly implies a programming error in the client.
234 <constant name="command invalid" value="503" class="hard error">
235 The client sent an invalid sequence of frames, attempting to perform
236 an operation that was considered invalid by the server. This usually
237 implies a programming error in the client.
239 <constant name="channel error" value="504" class="hard error">
240 The client attempted to work with a channel that had not been
241 correctly opened. This most likely indicates a fault in the client
244 <constant name="resource error" value="506" class="hard error">
245 The server could not complete the method because it lacked sufficient
246 resources. This may be due to the client creating too many of some
249 <constant name="not allowed" value="530" class="hard error">
250 The client tried to work with some entity in a manner that is
251 prohibited by the server, due to security settings or by some other
254 <constant name="not implemented" value="540" class="hard error">
255 The client tried to use functionality that is not implemented in the
258 <constant name="internal error" value="541" class="hard error">
259 The server could not complete the method because of an internal error.
260 The server may require intervention by an operator in order to resume
264 ======================================================
266 ======================================================
268 <domain name="access ticket" type="short">
269 access ticket granted by server
271 An access ticket granted by the server for a certain set of access
272 rights within a specific realm. Access tickets are valid within the
273 channel where they were created, and expire when the channel closes.
275 <assert check="ne" value="0"/>
277 <domain name="class id" type="short"/>
278 <domain name="consumer tag" type="shortstr">
281 Identifier for the consumer, valid within the current connection.
283 <rule implement="MUST">
284 The consumer tag is valid only within the channel from which the
285 consumer was created. I.e. a client MUST NOT create a consumer in
286 one channel and then use it in another.
289 <domain name="delivery tag" type="longlong">
290 server-assigned delivery tag
292 The server-assigned and channel-specific delivery tag
294 <rule implement="MUST">
295 The delivery tag is valid only within the channel from which the
296 message was received. I.e. a client MUST NOT receive a message on
297 one channel and then acknowledge it on another.
299 <rule implement="MUST">
300 The server MUST NOT use a zero value for delivery tags. Zero is
301 reserved for client use, meaning "all messages so far received".
304 <domain name="exchange name" type="shortstr">
307 The exchange name is a client-selected string that identifies
308 the exchange for publish methods. Exchange names may consist
309 of any mixture of digits, letters, and underscores. Exchange
310 names are scoped by the virtual host.
312 <assert check="length" value="127"/>
314 <domain name="known hosts" type="shortstr">
317 Specifies the list of equivalent or alternative hosts that the server
318 knows about, which will normally include the current server itself.
319 Clients can cache this information and use it when reconnecting to a
320 server after a failure.
322 <rule implement="MAY">
323 The server MAY leave this field empty if it knows of no other
327 <domain name="method id" type="short"/>
328 <domain name="no ack" type="bit">
329 no acknowledgement needed
331 If this field is set the server does not expect acknowledgments
332 for messages. That is, when a message is delivered to the client
333 the server automatically and silently acknowledges it on behalf
334 of the client. This functionality increases performance but at
335 the cost of reliability. Messages can get lost if a client dies
336 before it can deliver them to the application.
339 <domain name="no local" type="bit">
340 do not deliver own messages
342 If the no-local field is set the server will not send messages to
343 the client that published them.
346 <domain name="path" type="shortstr">
348 Must start with a slash "/" and continue with path names
349 separated by slashes. A path name consists of any combination
350 of at least one of [A-Za-z0-9] plus zero or more of [.-_+!=:].
352 <assert check="notnull"/>
353 <assert check="syntax" rule="path"/>
354 <assert check="length" value="127"/>
356 <domain name="peer properties" type="table">
358 This string provides a set of peer properties, used for
359 identification, debugging, and general information.
361 <rule implement="SHOULD">
362 The properties SHOULD contain these fields:
363 "product", giving the name of the peer product, "version", giving
364 the name of the peer version, "platform", giving the name of the
365 operating system, "copyright", if appropriate, and "information",
366 giving other general information.
369 <domain name="queue name" type="shortstr">
372 The queue name identifies the queue within the vhost. Queue
373 names may consist of any mixture of digits, letters, and
376 <assert check="length" value="127"/>
378 <domain name="redelivered" type="bit">
379 message is being redelivered
381 This indicates that the message has been previously delivered to
382 this or another client.
384 <rule implement="SHOULD">
385 The server SHOULD try to signal redelivered messages when it can.
386 When redelivering a message that was not successfully acknowledged,
387 the server SHOULD deliver it to the original client if possible.
389 <rule implement="MUST">
390 The client MUST NOT rely on the redelivered field but MUST take it
391 as a hint that the message may already have been processed. A
392 fully robust client must be able to track duplicate received messages
393 on non-transacted, and locally-transacted channels.
396 <domain name="reply code" type="short">
397 reply code from server
399 The reply code. The AMQ reply codes are defined in AMQ RFC 011.
401 <assert check="notnull"/>
403 <domain name="reply text" type="shortstr">
406 The localised reply text. This text can be logged as an aid to
409 <assert check="notnull"/>
411 <class name="connection" handler="connection" index="10">
413 ======================================================
415 ======================================================
417 work with socket connections
419 The connection class provides methods for a client to establish a
420 network connection to a server, and for both peers to operate the
421 connection thereafter.
424 connection = open-connection *use-connection close-connection
425 open-connection = C:protocol-header
429 C:OPEN S:OPEN-OK | S:REDIRECT
430 challenge = S:SECURE C:SECURE-OK
431 use-connection = *channel
432 close-connection = C:CLOSE S:CLOSE-OK
435 <chassis name="server" implement="MUST"/>
436 <chassis name="client" implement="MUST"/>
437 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
438 <method name="start" synchronous="1" index="10">
439 start connection negotiation
441 This method starts the connection negotiation process by telling
442 the client the protocol version that the server proposes, along
443 with a list of security mechanisms which the client can use for
446 <rule implement="MUST">
447 If the client cannot handle the protocol version suggested by the
448 server it MUST close the socket connection.
450 <rule implement="MUST">
451 The server MUST provide a protocol version that is lower than or
452 equal to that requested by the client in the protocol header. If
453 the server cannot support the specified protocol it MUST NOT send
454 this method, but MUST close the socket connection.
456 <chassis name="client" implement="MUST"/>
457 <response name="start-ok"/>
458 <field name="version major" type="octet">
459 protocol major version
461 The protocol major version that the server agrees to use, which
462 cannot be higher than the client's major version.
465 <field name="version minor" type="octet">
466 protocol major version
468 The protocol minor version that the server agrees to use, which
469 cannot be higher than the client's minor version.
472 <field name="server properties" domain="peer properties">
475 <field name="mechanisms" type="longstr">
476 available security mechanisms
478 A list of the security mechanisms that the server supports, delimited
479 by spaces. Currently ASL supports these mechanisms: PLAIN.
481 <see name="security mechanisms"/>
482 <assert check="notnull"/>
484 <field name="locales" type="longstr">
485 available message locales
487 A list of the message locales that the server supports, delimited
488 by spaces. The locale defines the language in which the server
489 will send reply texts.
491 <rule implement="MUST">
492 All servers MUST support at least the en_US locale.
494 <assert check="notnull"/>
497 <method name="start-ok" synchronous="1" index="11">
498 select security mechanism and locale
500 This method selects a SASL security mechanism. ASL uses SASL
501 (RFC2222) to negotiate authentication and encryption.
503 <chassis name="server" implement="MUST"/>
504 <field name="client properties" domain="peer properties">
507 <field name="mechanism" type="shortstr">
508 selected security mechanism
510 A single security mechanisms selected by the client, which must be
511 one of those specified by the server.
513 <rule implement="SHOULD">
514 The client SHOULD authenticate using the highest-level security
515 profile it can handle from the list provided by the server.
517 <rule implement="MUST">
518 The mechanism field MUST contain one of the security mechanisms
519 proposed by the server in the Start method. If it doesn't, the
520 server MUST close the socket.
522 <assert check="notnull"/>
524 <field name="response" type="longstr">
525 security response data
527 A block of opaque data passed to the security mechanism. The contents
528 of this data are defined by the SASL security mechanism. For the
529 PLAIN security mechanism this is defined as a field table holding
530 two fields, LOGIN and PASSWORD.
532 <assert check="notnull"/>
534 <field name="locale" type="shortstr">
535 selected message locale
537 A single message local selected by the client, which must be one
538 of those specified by the server.
540 <assert check="notnull"/>
543 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
544 <method name="secure" synchronous="1" index="20">
545 security mechanism challenge
547 The SASL protocol works by exchanging challenges and responses until
548 both peers have received sufficient information to authenticate each
549 other. This method challenges the client to provide more information.
551 <chassis name="client" implement="MUST"/>
552 <response name="secure-ok"/>
553 <field name="challenge" type="longstr">
554 security challenge data
556 Challenge information, a block of opaque binary data passed to
557 the security mechanism.
559 <see name="security mechanisms"/>
562 <method name="secure-ok" synchronous="1" index="21">
563 security mechanism response
565 This method attempts to authenticate, passing a block of SASL data
566 for the security mechanism at the server side.
568 <chassis name="server" implement="MUST"/>
569 <field name="response" type="longstr">
570 security response data
572 A block of opaque data passed to the security mechanism. The contents
573 of this data are defined by the SASL security mechanism.
575 <assert check="notnull"/>
578 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
579 <method name="tune" synchronous="1" index="30">
580 propose connection tuning parameters
582 This method proposes a set of connection configuration values
583 to the client. The client can accept and/or adjust these.
585 <chassis name="client" implement="MUST"/>
586 <response name="tune-ok"/>
587 <field name="channel max" type="short">
588 proposed maximum channels
590 The maximum total number of channels that the server allows
591 per connection. Zero means that the server does not impose a
592 fixed limit, but the number of allowed channels may be limited
593 by available server resources.
596 <field name="frame max" type="long">
597 proposed maximum frame size
599 The largest frame size that the server proposes for the
600 connection. The client can negotiate a lower value. Zero means
601 that the server does not impose any specific limit but may reject
602 very large frames if it cannot allocate resources for them.
604 <rule implement="MUST">
605 Until the frame-max has been negotiated, both peers MUST accept
606 frames of up to 4096 octets large. The minimum non-zero value for
607 the frame-max field is 4096.
610 <field name="heartbeat" type="short">
611 desired heartbeat delay
613 The delay, in seconds, of the connection heartbeat that the server
614 wants. Zero means the server does not want a heartbeat.
618 <method name="tune-ok" synchronous="1" index="31">
619 negotiate connection tuning parameters
621 This method sends the client's connection tuning parameters to the
622 server. Certain fields are negotiated, others provide capability
625 <chassis name="server" implement="MUST"/>
626 <field name="channel max" type="short">
627 negotiated maximum channels
629 The maximum total number of channels that the client will use
630 per connection. May not be higher than the value specified by
633 <rule implement="MAY">
634 The server MAY ignore the channel-max value or MAY use it for
635 tuning its resource allocation.
637 <assert check="notnull"/>
638 <assert check="le" method="tune" field="channel max"/>
640 <field name="frame max" type="long">
641 negotiated maximum frame size
643 The largest frame size that the client and server will use for
644 the connection. Zero means that the client does not impose any
645 specific limit but may reject very large frames if it cannot
646 allocate resources for them. Note that the frame-max limit
647 applies principally to content frames, where large contents
648 can be broken into frames of arbitrary size.
650 <rule implement="MUST">
651 Until the frame-max has been negotiated, both peers must accept
652 frames of up to 4096 octets large. The minimum non-zero value for
653 the frame-max field is 4096.
656 <field name="heartbeat" type="short">
657 desired heartbeat delay
659 The delay, in seconds, of the connection heartbeat that the client
660 wants. Zero means the client does not want a heartbeat.
664 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
665 <method name="open" synchronous="1" index="40">
666 open connection to virtual host
668 This method opens a connection to a virtual host, which is a
669 collection of resources, and acts to separate multiple application
670 domains within a server.
672 <rule implement="MUST">
673 The client MUST open the context before doing any work on the
676 <chassis name="server" implement="MUST"/>
677 <response name="open-ok"/>
678 <response name="redirect"/>
679 <field name="virtual host" domain="path">
681 <assert check="regexp" value="^[a-zA-Z0-9/-_]+$"/>
683 The name of the virtual host to work with.
685 <rule implement="MUST">
686 If the server supports multiple virtual hosts, it MUST enforce a
687 full separation of exchanges, queues, and all associated entities
688 per virtual host. An application, connected to a specific virtual
689 host, MUST NOT be able to access resources of another virtual host.
691 <rule implement="SHOULD">
692 The server SHOULD verify that the client has permission to access
693 the specified virtual host.
695 <rule implement="MAY">
696 The server MAY configure arbitrary limits per virtual host, such
697 as the number of each type of entity that may be used, per
698 connection and/or in total.
701 <field name="capabilities" type="shortstr">
702 required capabilities
704 The client may specify a number of capability names, delimited by
705 spaces. The server can use this string to how to process the
706 client's connection request.
709 <field name="insist" type="bit">
710 insist on connecting to server
712 In a configuration with multiple load-sharing servers, the server
713 may respond to a Connection.Open method with a Connection.Redirect.
714 The insist option tells the server that the client is insisting on
715 a connection to the specified server.
717 <rule implement="SHOULD">
718 When the client uses the insist option, the server SHOULD accept
719 the client connection unless it is technically unable to do so.
723 <method name="open-ok" synchronous="1" index="41">
724 signal that the connection is ready
726 This method signals to the client that the connection is ready for
729 <chassis name="client" implement="MUST"/>
730 <field name="known hosts" domain="known hosts"/>
732 <method name="redirect" synchronous="1" index="50">
733 asks the client to use a different server
735 This method redirects the client to another server, based on the
736 requested virtual host and/or capabilities.
738 <rule implement="SHOULD">
739 When getting the Connection.Redirect method, the client SHOULD
740 reconnect to the host specified, and if that host is not present,
741 to any of the hosts specified in the known-hosts list.
743 <chassis name="client" implement="MAY"/>
744 <field name="host" type="shortstr">
747 Specifies the server to connect to. This is an IP address or a
748 DNS name, optionally followed by a colon and a port number. If
749 no port number is specified, the client should use the default
750 port number for the protocol.
752 <assert check="notnull"/>
754 <field name="known hosts" domain="known hosts"/>
756 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
757 <method name="close" synchronous="1" index="60">
758 request a connection close
760 This method indicates that the sender wants to close the connection.
761 This may be due to internal conditions (e.g. a forced shut-down) or
762 due to an error handling a specific method, i.e. an exception. When
763 a close is due to an exception, the sender provides the class and
764 method id of the method which caused the exception.
766 <rule implement="MUST">
767 After sending this method any received method except the Close-OK
768 method MUST be discarded.
770 <rule implement="MAY">
771 The peer sending this method MAY use a counter or timeout to
772 detect failure of the other peer to respond correctly with
775 <rule implement="MUST">
776 When a server receives the Close method from a client it MUST
777 delete all server-side resources associated with the client's
778 context. A client CANNOT reconnect to a context after sending
779 or receiving a Close method.
781 <chassis name="client" implement="MUST"/>
782 <chassis name="server" implement="MUST"/>
783 <response name="close-ok"/>
784 <field name="reply code" domain="reply code"/>
785 <field name="reply text" domain="reply text"/>
786 <field name="class id" domain="class id">
789 When the close is provoked by a method exception, this is the
793 <field name="method id" domain="class id">
796 When the close is provoked by a method exception, this is the
801 <method name="close-ok" synchronous="1" index="61">
802 confirm a connection close
804 This method confirms a Connection.Close method and tells the
805 recipient that it is safe to release resources for the connection
806 and close the socket.
808 <rule implement="SHOULD">
809 A peer that detects a socket closure without having received a
810 Close-Ok handshake method SHOULD log the error.
812 <chassis name="client" implement="MUST"/>
813 <chassis name="server" implement="MUST"/>
816 <class name="channel" handler="channel" index="20">
818 ======================================================
820 ======================================================
824 The channel class provides methods for a client to establish a virtual
825 connection - a channel - to a server and for both peers to operate the
826 virtual connection thereafter.
829 channel = open-channel *use-channel close-channel
830 open-channel = C:OPEN S:OPEN-OK
831 use-channel = C:FLOW S:FLOW-OK
835 close-channel = C:CLOSE S:CLOSE-OK
838 <chassis name="server" implement="MUST"/>
839 <chassis name="client" implement="MUST"/>
840 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
841 <method name="open" synchronous="1" index="10">
842 open a channel for use
844 This method opens a virtual connection (a channel).
846 <rule implement="MUST">
847 This method MUST NOT be called when the channel is already open.
849 <chassis name="server" implement="MUST"/>
850 <response name="open-ok"/>
851 <field name="out of band" type="shortstr">
854 Configures out-of-band transfers on this channel. The syntax and
855 meaning of this field will be formally defined at a later date.
857 <assert check="null"/>
860 <method name="open-ok" synchronous="1" index="11">
861 signal that the channel is ready
863 This method signals to the client that the channel is ready for use.
865 <chassis name="client" implement="MUST"/>
867 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
868 <method name="flow" synchronous="1" index="20">
869 enable/disable flow from peer
871 This method asks the peer to pause or restart the flow of content
872 data. This is a simple flow-control mechanism that a peer can use
873 to avoid oveflowing its queues or otherwise finding itself receiving
874 more messages than it can process. Note that this method is not
875 intended for window control. The peer that receives a request to
876 stop sending content should finish sending the current content, if
877 any, and then wait until it receives a Flow restart method.
879 <rule implement="MAY">
880 When a new channel is opened, it is active. Some applications
881 assume that channels are inactive until started. To emulate this
882 behaviour a client MAY open the channel, then pause it.
884 <rule implement="SHOULD">
885 When sending content data in multiple frames, a peer SHOULD monitor
886 the channel for incoming methods and respond to a Channel.Flow as
889 <rule implement="MAY">
890 A peer MAY use the Channel.Flow method to throttle incoming content
891 data for internal reasons, for example, when exchangeing data over a
894 <rule implement="MAY">
895 The peer that requests a Channel.Flow method MAY disconnect and/or
896 ban a peer that does not respect the request.
898 <chassis name="server" implement="MUST"/>
899 <chassis name="client" implement="MUST"/>
900 <response name="flow-ok"/>
901 <field name="active" type="bit">
902 start/stop content frames
904 If 1, the peer starts sending content frames. If 0, the peer
905 stops sending content frames.
909 <method name="flow-ok" index="21">
910 confirm a flow method
912 Confirms to the peer that a flow command was received and processed.
914 <chassis name="server" implement="MUST"/>
915 <chassis name="client" implement="MUST"/>
916 <field name="active" type="bit">
919 Confirms the setting of the processed flow method: 1 means the
920 peer will start sending or continue to send content frames; 0
925 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
926 <method name="alert" index="30">
927 send a non-fatal warning message
929 This method allows the server to send a non-fatal warning to the
930 client. This is used for methods that are normally asynchronous
931 and thus do not have confirmations, and for which the server may
932 detect errors that need to be reported. Fatal errors are handled
933 as channel or connection exceptions; non-fatal errors are sent
936 <chassis name="client" implement="MUST"/>
937 <field name="reply code" domain="reply code"/>
938 <field name="reply text" domain="reply text"/>
939 <field name="details" type="table">
940 detailed information for warning
942 A set of fields that provide more information about the
943 problem. The meaning of these fields are defined on a
944 per-reply-code basis (TO BE DEFINED).
948 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
949 <method name="close" synchronous="1" index="40">
950 request a channel close
952 This method indicates that the sender wants to close the channel.
953 This may be due to internal conditions (e.g. a forced shut-down) or
954 due to an error handling a specific method, i.e. an exception. When
955 a close is due to an exception, the sender provides the class and
956 method id of the method which caused the exception.
958 <rule implement="MUST">
959 After sending this method any received method except
960 Channel.Close-OK MUST be discarded.
962 <rule implement="MAY">
963 The peer sending this method MAY use a counter or timeout to detect
964 failure of the other peer to respond correctly with Channel.Close-OK..
966 <chassis name="client" implement="MUST"/>
967 <chassis name="server" implement="MUST"/>
968 <response name="close-ok"/>
969 <field name="reply code" domain="reply code"/>
970 <field name="reply text" domain="reply text"/>
971 <field name="class id" domain="class id">
974 When the close is provoked by a method exception, this is the
978 <field name="method id" domain="method id">
981 When the close is provoked by a method exception, this is the
986 <method name="close-ok" synchronous="1" index="41">
987 confirm a channel close
989 This method confirms a Channel.Close method and tells the recipient
990 that it is safe to release resources for the channel and close the
993 <rule implement="SHOULD">
994 A peer that detects a socket closure without having received a
995 Channel.Close-Ok handshake method SHOULD log the error.
997 <chassis name="client" implement="MUST"/>
998 <chassis name="server" implement="MUST"/>
1001 <class name="access" handler="connection" index="30">
1003 ======================================================
1005 ======================================================
1007 work with access tickets
1009 The protocol control access to server resources using access tickets.
1010 A client must explicitly request access tickets before doing work.
1011 An access ticket grants a client the right to use a specific set of
1012 resources - called a "realm" - in specific ways.
1014 <doc name="grammar">
1015 access = C:REQUEST S:REQUEST-OK
1017 <chassis name="server" implement="MUST"/>
1018 <chassis name="client" implement="MUST"/>
1019 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1020 <method name="request" synchronous="1" index="10">
1021 request an access ticket
1023 This method requests an access ticket for an access realm.
1024 The server responds by granting the access ticket. If the
1025 client does not have access rights to the requested realm
1026 this causes a connection exception. Access tickets are a
1027 per-channel resource.
1029 <rule implement="MUST">
1030 The realm name MUST start with either "/data" (for application
1031 resources) or "/admin" (for server administration resources).
1032 If the realm starts with any other path, the server MUST raise
1033 a connection exception with reply code 403 (access refused).
1035 <rule implement="MUST">
1036 The server MUST implement the /data realm and MAY implement the
1037 /admin realm. The mapping of resources to realms is not
1038 defined in the protocol - this is a server-side configuration
1041 <chassis name="server" implement="MUST"/>
1042 <response name="request-ok"/>
1043 <field name="realm" domain="path">
1044 name of requested realm
1045 <rule implement="MUST">
1046 If the specified realm is not known to the server, the server
1047 must raise a channel exception with reply code 402 (invalid
1051 <field name="exclusive" type="bit">
1052 request exclusive access
1054 Request exclusive access to the realm. If the server cannot grant
1055 this - because there are other active tickets for the realm - it
1056 raises a channel exception.
1059 <field name="passive" type="bit">
1060 request passive access
1062 Request message passive access to the specified access realm.
1063 Passive access lets a client get information about resources in
1064 the realm but not to make any changes to them.
1067 <field name="active" type="bit">
1068 request active access
1070 Request message active access to the specified access realm.
1071 Acvtive access lets a client get create and delete resources in
1075 <field name="write" type="bit">
1076 request write access
1078 Request write access to the specified access realm. Write access
1079 lets a client publish messages to all exchanges in the realm.
1082 <field name="read" type="bit">
1085 Request read access to the specified access realm. Read access
1086 lets a client consume messages from queues in the realm.
1090 <method name="request-ok" synchronous="1" index="11">
1091 grant access to server resources
1093 This method provides the client with an access ticket. The access
1094 ticket is valid within the current channel and for the lifespan of
1097 <rule implement="MUST">
1098 The client MUST NOT use access tickets except within the same
1099 channel as originally granted.
1101 <rule implement="MUST">
1102 The server MUST isolate access tickets per channel and treat an
1103 attempt by a client to mix these as a connection exception.
1105 <chassis name="client" implement="MUST"/>
1106 <field name="ticket" domain="access ticket"/>
1109 <class name="exchange" handler="channel" index="40">
1111 ======================================================
1112 == EXCHANGES (or "routers", if you prefer)
1113 == (Or matchers, plugins, extensions, agents,... Routing is just one of
1114 == the many fun things an exchange can do.)
1115 ======================================================
1119 Exchanges match and distribute messages across queues. Exchanges can be
1120 configured in the server or created at runtime.
1122 <doc name="grammar">
1123 exchange = C:DECLARE S:DECLARE-OK
1124 / C:DELETE S:DELETE-OK
1126 <chassis name="server" implement="MUST"/>
1127 <chassis name="client" implement="MUST"/>
1128 <rule implement="MUST">
1129 <test>amq_exchange_19</test>
1130 The server MUST implement the direct and fanout exchange types, and
1131 predeclare the corresponding exchanges named amq.direct and amq.fanout
1132 in each virtual host. The server MUST also predeclare a direct
1133 exchange to act as the default exchange for content Publish methods
1134 and for default queue bindings.
1136 <rule implement="SHOULD">
1137 <test>amq_exchange_20</test>
1138 The server SHOULD implement the topic exchange type, and predeclare
1139 the corresponding exchange named amq.topic in each virtual host.
1141 <rule implement="MAY">
1142 <test>amq_exchange_21</test>
1143 The server MAY implement the system exchange type, and predeclare the
1144 corresponding exchanges named amq.system in each virtual host. If the
1145 client attempts to bind a queue to the system exchange, the server
1146 MUST raise a connection exception with reply code 507 (not allowed).
1148 <rule implement="MUST">
1149 <test>amq_exchange_22</test>
1150 The default exchange MUST be defined as internal, and be inaccessible
1151 to the client except by specifying an empty exchange name in a content
1152 Publish method. That is, the server MUST NOT let clients make explicit
1153 bindings to this exchange.
1155 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1156 <method name="declare" synchronous="1" index="10">
1157 declare exchange, create if needed
1159 This method creates an exchange if it does not already exist, and if the
1160 exchange exists, verifies that it is of the correct and expected class.
1162 <rule implement="SHOULD">
1163 <test>amq_exchange_23</test>
1164 The server SHOULD support a minimum of 16 exchanges per virtual host
1165 and ideally, impose no limit except as defined by available resources.
1167 <chassis name="server" implement="MUST"/>
1168 <response name="declare-ok"/>
1169 <field name="ticket" domain="access ticket">
1171 When a client defines a new exchange, this belongs to the access realm
1172 of the ticket used. All further work done with that exchange must be
1173 done with an access ticket for the same realm.
1175 <rule implement="MUST">
1176 The client MUST provide a valid access ticket giving "active" access
1177 to the realm in which the exchange exists or will be created, or
1178 "passive" access if the if-exists flag is set.
1181 <field name="exchange" domain="exchange name">
1182 <rule implement="MUST">
1183 <test>amq_exchange_15</test>
1184 Exchange names starting with "amq." are reserved for predeclared
1185 and standardised exchanges. If the client attempts to create an
1186 exchange starting with "amq.", the server MUST raise a channel
1187 exception with reply code 403 (access refused).
1189 <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
1191 <field name="type" type="shortstr">
1194 Each exchange belongs to one of a set of exchange types implemented
1195 by the server. The exchange types define the functionality of the
1196 exchange - i.e. how messages are routed through it. It is not valid
1197 or meaningful to attempt to change the type of an existing exchange.
1199 <rule implement="MUST">
1200 <test>amq_exchange_16</test>
1201 If the exchange already exists with a different type, the server
1202 MUST raise a connection exception with a reply code 507 (not allowed).
1204 <rule implement="MUST">
1205 <test>amq_exchange_18</test>
1206 If the server does not support the requested exchange type it MUST
1207 raise a connection exception with a reply code 503 (command invalid).
1209 <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
1211 <field name="passive" type="bit">
1212 do not create exchange
1214 If set, the server will not create the exchange. The client can use
1215 this to check whether an exchange exists without modifying the server
1218 <rule implement="MUST">
1219 <test>amq_exchange_05</test>
1220 If set, and the exchange does not already exist, the server MUST
1221 raise a channel exception with reply code 404 (not found).
1224 <field name="durable" type="bit">
1225 request a durable exchange
1227 If set when creating a new exchange, the exchange will be marked as
1228 durable. Durable exchanges remain active when a server restarts.
1229 Non-durable exchanges (transient exchanges) are purged if/when a
1232 <rule implement="MUST">
1233 <test>amq_exchange_24</test>
1234 The server MUST support both durable and transient exchanges.
1236 <rule implement="MUST">
1237 The server MUST ignore the durable field if the exchange already
1241 <field name="auto delete" type="bit">
1242 auto-delete when unused
1244 If set, the exchange is deleted when all queues have finished
1247 <rule implement="SHOULD">
1248 <test>amq_exchange_02</test>
1249 The server SHOULD allow for a reasonable delay between the point
1250 when it determines that an exchange is not being used (or no longer
1251 used), and the point when it deletes the exchange. At the least it
1252 must allow a client to create an exchange and then bind a queue to
1253 it, with a small but non-zero delay between these two actions.
1255 <rule implement="MUST">
1256 <test>amq_exchange_25</test>
1257 The server MUST ignore the auto-delete field if the exchange already
1261 <field name="internal" type="bit">
1262 create internal exchange
1264 If set, the exchange may not be used directly by publishers, but
1265 only when bound to other exchanges. Internal exchanges are used to
1266 construct wiring that is not visible to applications.
1270 <field name = "nowait" type = "bit">
1271 do not send a reply method
1273 If set, the server will not respond to the method. The client should
1274 not wait for a reply method. If the server could not complete the
1275 method it will raise a channel or connection exception.
1279 <field name="arguments" type="table">
1280 arguments for declaration
1282 A set of arguments for the declaration. The syntax and semantics
1283 of these arguments depends on the server implementation. This
1284 field is ignored if passive is 1.
1288 <method name="declare-ok" synchronous="1" index="11">
1289 confirms an exchange declaration
1291 This method confirms a Declare method and confirms the name of the
1292 exchange, essential for automatically-named exchanges.
1294 <chassis name="client" implement="MUST"/>
1296 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1297 <method name="delete" synchronous="1" index="20">
1300 This method deletes an exchange. When an exchange is deleted all queue
1301 bindings on the exchange are cancelled.
1303 <chassis name="server" implement="MUST"/>
1304 <response name="delete-ok"/>
1305 <field name="ticket" domain="access ticket">
1306 <rule implement="MUST">
1307 The client MUST provide a valid access ticket giving "active"
1308 access rights to the exchange's access realm.
1311 <field name="exchange" domain="exchange name">
1312 <rule implement="MUST">
1313 <test>amq_exchange_11</test>
1314 The exchange MUST exist. Attempting to delete a non-existing exchange
1315 causes a channel exception.
1317 <assert check="notnull"/>
1319 <field name="if unused" type="bit">
1320 delete only if unused
1322 If set, the server will only delete the exchange if it has no queue
1323 bindings. If the exchange has queue bindings the server does not
1324 delete it but raises a channel exception instead.
1326 <rule implement="SHOULD">
1327 <test>amq_exchange_12</test>
1328 If set, the server SHOULD delete the exchange but only if it has
1331 <rule implement="SHOULD">
1332 <test>amq_exchange_13</test>
1333 If set, the server SHOULD raise a channel exception if the exchange is in
1338 <field name = "nowait" type = "bit">
1339 do not send a reply method
1341 If set, the server will not respond to the method. The client should
1342 not wait for a reply method. If the server could not complete the
1343 method it will raise a channel or connection exception.
1348 <method name="delete-ok" synchronous="1" index="21">
1349 confirm deletion of an exchange
1351 This method confirms the deletion of an exchange.
1353 <chassis name="client" implement="MUST"/>
1356 <method name="bound" synchronous="1" index="22">
1357 <field name="exchange" domain="exchange name"/>
1358 <field name = "routing key" type = "shortstr">
1361 Specifies the routing key for the message. The routing key is
1362 used for routing messages depending on the exchange configuration.
1365 <field name = "queue" domain = "queue name"/>
1368 <method name="bound-ok" synchronous="1" index="23">
1369 <field name="reply code" domain="reply code"/>
1370 <field name="reply text" domain="reply text"/>
1376 <class name="queue" handler="channel" index="50">
1378 ======================================================
1380 ======================================================
1385 Queues store and forward messages. Queues can be configured in the server
1386 or created at runtime. Queues must be attached to at least one exchange
1387 in order to receive messages from publishers.
1389 <doc name="grammar">
1390 queue = C:DECLARE S:DECLARE-OK
1392 / C:PURGE S:PURGE-OK
1393 / C:DELETE S:DELETE-OK
1395 <chassis name="server" implement="MUST"/>
1396 <chassis name="client" implement="MUST"/>
1397 <rule implement="MUST">
1398 <test>amq_queue_33</test>
1399 A server MUST allow any content class to be sent to any queue, in any
1400 mix, and queue and delivery these content classes independently. Note
1401 that all methods that fetch content off queues are specific to a given
1404 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1405 <method name="declare" synchronous="1" index="10">
1406 declare queue, create if needed
1408 This method creates or checks a queue. When creating a new queue
1409 the client can specify various properties that control the durability
1410 of the queue and its contents, and the level of sharing for the queue.
1412 <rule implement="MUST">
1413 <test>amq_queue_34</test>
1414 The server MUST create a default binding for a newly-created queue
1415 to the default exchange, which is an exchange of type 'direct'.
1417 <rule implement="SHOULD">
1418 <test>amq_queue_35</test>
1419 The server SHOULD support a minimum of 256 queues per virtual host
1420 and ideally, impose no limit except as defined by available resources.
1422 <chassis name="server" implement="MUST"/>
1423 <response name="declare-ok"/>
1424 <field name="ticket" domain="access ticket">
1426 When a client defines a new queue, this belongs to the access realm
1427 of the ticket used. All further work done with that queue must be
1428 done with an access ticket for the same realm.
1431 The client provides a valid access ticket giving "active" access
1432 to the realm in which the queue exists or will be created, or
1433 "passive" access if the if-exists flag is set.
1436 <field name="queue" domain="queue name">
1437 <rule implement="MAY">
1438 <test>amq_queue_10</test>
1439 The queue name MAY be empty, in which case the server MUST create
1440 a new queue with a unique generated name and return this to the
1441 client in the Declare-Ok method.
1443 <rule implement="MUST">
1444 <test>amq_queue_32</test>
1445 Queue names starting with "amq." are reserved for predeclared and
1446 standardised server queues. If the queue name starts with "amq."
1447 and the passive option is zero, the server MUST raise a connection
1448 exception with reply code 403 (access refused).
1450 <assert check="regexp" value="^[a-zA-Z0-9-_.:]*$"/>
1452 <field name="passive" type="bit">
1455 If set, the server will not create the queue. The client can use
1456 this to check whether a queue exists without modifying the server
1459 <rule implement="MUST">
1460 <test>amq_queue_05</test>
1461 If set, and the queue does not already exist, the server MUST
1462 respond with a reply code 404 (not found) and raise a channel
1466 <field name="durable" type="bit">
1467 request a durable queue
1469 If set when creating a new queue, the queue will be marked as
1470 durable. Durable queues remain active when a server restarts.
1471 Non-durable queues (transient queues) are purged if/when a
1472 server restarts. Note that durable queues do not necessarily
1473 hold persistent messages, although it does not make sense to
1474 send persistent messages to a transient queue.
1476 <rule implement="MUST">
1477 <test>amq_queue_03</test>
1478 The server MUST recreate the durable queue after a restart.
1480 <rule implement="MUST">
1481 <test>amq_queue_36</test>
1482 The server MUST support both durable and transient queues.
1484 <rule implement="MUST">
1485 <test>amq_queue_37</test>
1486 The server MUST ignore the durable field if the queue already
1490 <field name="exclusive" type="bit">
1491 request an exclusive queue
1493 Exclusive queues may only be consumed from by the current connection.
1494 Setting the 'exclusive' flag always implies 'auto-delete'.
1496 <rule implement="MUST">
1497 <test>amq_queue_38</test>
1498 The server MUST support both exclusive (private) and non-exclusive
1501 <rule implement="MUST">
1502 <test>amq_queue_04</test>
1503 The server MUST raise a channel exception if 'exclusive' is specified
1504 and the queue already exists and is owned by a different connection.
1507 <field name="auto delete" type="bit">
1508 auto-delete queue when unused
1510 If set, the queue is deleted when all consumers have finished
1511 using it. Last consumer can be cancelled either explicitly or because
1512 its channel is closed. If there was no consumer ever on the queue, it
1515 <rule implement="SHOULD">
1516 <test>amq_queue_02</test>
1517 The server SHOULD allow for a reasonable delay between the point
1518 when it determines that a queue is not being used (or no longer
1519 used), and the point when it deletes the queue. At the least it
1520 must allow a client to create a queue and then create a consumer
1521 to read from it, with a small but non-zero delay between these
1522 two actions. The server should equally allow for clients that may
1523 be disconnected prematurely, and wish to re-consume from the same
1524 queue without losing messages. We would recommend a configurable
1525 timeout, with a suitable default value being one minute.
1527 <rule implement="MUST">
1528 <test>amq_queue_31</test>
1529 The server MUST ignore the auto-delete field if the queue already
1533 <field name = "nowait" type = "bit">
1534 do not send a reply method
1536 If set, the server will not respond to the method. The client should
1537 not wait for a reply method. If the server could not complete the
1538 method it will raise a channel or connection exception.
1542 <field name="arguments" type="table">
1543 arguments for declaration
1545 A set of arguments for the declaration. The syntax and semantics
1546 of these arguments depends on the server implementation. This
1547 field is ignored if passive is 1.
1551 <method name="declare-ok" synchronous="1" index="11">
1552 confirms a queue definition
1554 This method confirms a Declare method and confirms the name of the
1555 queue, essential for automatically-named queues.
1557 <chassis name="client" implement="MUST"/>
1558 <field name="queue" domain="queue name">
1560 Reports the name of the queue. If the server generated a queue
1561 name, this field contains that name.
1563 <assert check="notnull"/>
1565 <field name="message count" type="long">
1566 number of messages in queue
1568 Reports the number of messages in the queue, which will be zero
1569 for newly-created queues.
1572 <field name="consumer count" type="long">
1575 Reports the number of active consumers for the queue. Note that
1576 consumers can suspend activity (Channel.Flow) in which case they
1577 do not appear in this count.
1581 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1582 <method name="bind" synchronous="1" index="20">
1583 bind queue to an exchange
1585 This method binds a queue to an exchange. Until a queue is
1586 bound it will not receive any messages. In a classic messaging
1587 model, store-and-forward queues are bound to a dest exchange
1588 and subscription queues are bound to a dest_wild exchange.
1590 <rule implement="MUST">
1591 <test>amq_queue_25</test>
1592 A server MUST allow ignore duplicate bindings - that is, two or
1593 more bind methods for a specific queue, with identical arguments
1594 - without treating these as an error.
1596 <rule implement="MUST">
1597 <test>amq_queue_39</test>
1598 If a bind fails, the server MUST raise a connection exception.
1600 <rule implement="MUST">
1601 <test>amq_queue_12</test>
1602 The server MUST NOT allow a durable queue to bind to a transient
1603 exchange. If the client attempts this the server MUST raise a
1606 <rule implement="SHOULD">
1607 <test>amq_queue_13</test>
1608 Bindings for durable queues are automatically durable and the
1609 server SHOULD restore such bindings after a server restart.
1611 <rule implement="MUST">
1612 <test>amq_queue_17</test>
1613 If the client attempts to an exchange that was declared as internal,
1614 the server MUST raise a connection exception with reply code 530
1617 <rule implement="SHOULD">
1618 <test>amq_queue_40</test>
1619 The server SHOULD support at least 4 bindings per queue, and
1620 ideally, impose no limit except as defined by available resources.
1622 <chassis name="server" implement="MUST"/>
1623 <response name="bind-ok"/>
1624 <field name="ticket" domain="access ticket">
1626 The client provides a valid access ticket giving "active"
1627 access rights to the queue's access realm.
1631 <field name = "queue" domain = "queue name">
1633 Specifies the name of the queue to bind. If the queue name is
1634 empty, refers to the current queue for the channel, which is
1635 the last declared queue.
1638 If the client did not previously declare a queue, and the queue
1639 name in this method is empty, the server MUST raise a connection
1640 exception with reply code 530 (not allowed).
1642 <doc name = "rule" test = "amq_queue_26">
1643 If the queue does not exist the server MUST raise a channel exception
1644 with reply code 404 (not found).
1648 <field name="exchange" domain="exchange name">
1649 The name of the exchange to bind to.
1650 <rule implement="MUST">
1651 <test>amq_queue_14</test>
1652 If the exchange does not exist the server MUST raise a channel
1653 exception with reply code 404 (not found).
1656 <field name="routing key" type="shortstr">
1659 Specifies the routing key for the binding. The routing key is
1660 used for routing messages depending on the exchange configuration.
1661 Not all exchanges use a routing key - refer to the specific
1662 exchange documentation. If the routing key is empty and the queue
1663 name is empty, the routing key will be the current queue for the
1664 channel, which is the last declared queue.
1668 <field name = "nowait" type = "bit">
1669 do not send a reply method
1671 If set, the server will not respond to the method. The client should
1672 not wait for a reply method. If the server could not complete the
1673 method it will raise a channel or connection exception.
1677 <field name="arguments" type="table">
1678 arguments for binding
1680 A set of arguments for the binding. The syntax and semantics of
1681 these arguments depends on the exchange class.
1685 <method name="bind-ok" synchronous="1" index="21">
1686 confirm bind successful
1688 This method confirms that the bind was successful.
1690 <chassis name="client" implement="MUST"/>
1692 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1693 <method name="purge" synchronous="1" index="30">
1696 This method removes all messages from a queue. It does not cancel
1697 consumers. Purged messages are deleted without any formal "undo"
1700 <rule implement="MUST">
1701 <test>amq_queue_15</test>
1702 A call to purge MUST result in an empty queue.
1704 <rule implement="MUST">
1705 <test>amq_queue_41</test>
1706 On transacted channels the server MUST not purge messages that have
1707 already been sent to a client but not yet acknowledged.
1709 <rule implement="MAY">
1710 <test>amq_queue_42</test>
1711 The server MAY implement a purge queue or log that allows system
1712 administrators to recover accidentally-purged messages. The server
1713 SHOULD NOT keep purged messages in the same storage spaces as the
1714 live messages since the volumes of purged messages may get very
1717 <chassis name="server" implement="MUST"/>
1718 <response name="purge-ok"/>
1719 <field name="ticket" domain="access ticket">
1721 The access ticket must be for the access realm that holds the
1724 <rule implement="MUST">
1725 The client MUST provide a valid access ticket giving "read" access
1726 rights to the queue's access realm. Note that purging a queue is
1727 equivalent to reading all messages and discarding them.
1730 <field name = "queue" domain = "queue name">
1732 Specifies the name of the queue to purge. If the queue name is
1733 empty, refers to the current queue for the channel, which is
1734 the last declared queue.
1737 If the client did not previously declare a queue, and the queue
1738 name in this method is empty, the server MUST raise a connection
1739 exception with reply code 530 (not allowed).
1741 <doc name = "rule" test = "amq_queue_16">
1742 The queue must exist. Attempting to purge a non-existing queue
1743 causes a channel exception.
1747 <field name = "nowait" type = "bit">
1748 do not send a reply method
1750 If set, the server will not respond to the method. The client should
1751 not wait for a reply method. If the server could not complete the
1752 method it will raise a channel or connection exception.
1756 <method name="purge-ok" synchronous="1" index="31">
1757 confirms a queue purge
1759 This method confirms the purge of a queue.
1761 <chassis name="client" implement="MUST"/>
1762 <field name="message count" type="long">
1763 number of messages purged
1765 Reports the number of messages purged.
1769 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1770 <method name="delete" synchronous="1" index="40">
1773 This method deletes a queue. When a queue is deleted any pending
1774 messages are sent to a dead-letter queue if this is defined in the
1775 server configuration, and all consumers on the queue are cancelled.
1777 <rule implement="SHOULD">
1778 <test>amq_queue_43</test>
1779 The server SHOULD use a dead-letter queue to hold messages that
1780 were pending on a deleted queue, and MAY provide facilities for
1781 a system administrator to move these messages back to an active
1784 <chassis name="server" implement="MUST"/>
1785 <response name="delete-ok"/>
1786 <field name="ticket" domain="access ticket">
1788 The client provides a valid access ticket giving "active"
1789 access rights to the queue's access realm.
1793 <field name = "queue" domain = "queue name">
1795 Specifies the name of the queue to delete. If the queue name is
1796 empty, refers to the current queue for the channel, which is the
1797 last declared queue.
1800 If the client did not previously declare a queue, and the queue
1801 name in this method is empty, the server MUST raise a connection
1802 exception with reply code 530 (not allowed).
1804 <doc name = "rule" test = "amq_queue_21">
1805 The queue must exist. Attempting to delete a non-existing queue
1806 causes a channel exception.
1810 <field name="if unused" type="bit">
1811 delete only if unused
1813 If set, the server will only delete the queue if it has no
1814 consumers. If the queue has consumers the server does does not
1815 delete it but raises a channel exception instead.
1817 <rule implement="MUST">
1818 <test>amq_queue_29</test>
1819 <test>amq_queue_30</test>
1820 The server MUST respect the if-unused flag when deleting a queue.
1823 <field name="if empty" type="bit">
1824 delete only if empty
1825 <test>amq_queue_27</test>
1827 If set, the server will only delete the queue if it has no
1828 messages. If the queue is not empty the server raises a channel
1832 <field name = "nowait" type = "bit">
1833 do not send a reply method
1835 If set, the server will not respond to the method. The client should
1836 not wait for a reply method. If the server could not complete the
1837 method it will raise a channel or connection exception.
1842 <method name="delete-ok" synchronous="1" index="41">
1843 confirm deletion of a queue
1845 This method confirms the deletion of a queue.
1847 <chassis name="client" implement="MUST"/>
1848 <field name="message count" type="long">
1849 number of messages purged
1851 Reports the number of messages purged.
1856 <class name="basic" handler="channel" index="60">
1858 ======================================================
1860 ======================================================
1862 work with basic content
1864 The Basic class provides methods that support an industry-standard
1868 <doc name = "grammar">
1869 basic = C:QOS S:QOS-OK
1870 / C:CONSUME S:CONSUME-OK
1871 / C:CANCEL S:CANCEL-OK
1875 / C:GET ( S:GET-OK content / S:GET-EMPTY )
1880 <chassis name = "server" implement = "MUST" />
1881 <chassis name = "client" implement = "MAY" />
1883 <doc name = "rule" test = "amq_basic_08">
1884 The server SHOULD respect the persistent property of basic messages
1885 and SHOULD make a best-effort to hold persistent basic messages on a
1886 reliable storage mechanism.
1888 <doc name = "rule" test = "amq_basic_09">
1889 The server MUST NOT discard a persistent basic message in case of a
1890 queue overflow. The server MAY use the Channel.Flow method to slow
1891 or stop a basic message publisher when necessary.
1893 <doc name = "rule" test = "amq_basic_10">
1894 The server MAY overflow non-persistent basic messages to persistent
1895 storage and MAY discard or dead-letter non-persistent basic messages
1896 on a priority basis if the queue size exceeds some configured limit.
1898 <doc name = "rule" test = "amq_basic_11">
1899 The server MUST implement at least 2 priority levels for basic
1900 messages, where priorities 0-4 and 5-9 are treated as two distinct
1901 levels. The server MAY implement up to 10 priority levels.
1903 <doc name = "rule" test = "amq_basic_12">
1904 The server MUST deliver messages of the same priority in order
1905 irrespective of their individual persistence.
1907 <doc name = "rule" test = "amq_basic_13">
1908 The server MUST support both automatic and explicit acknowledgements
1912 <!-- These are the properties for a Basic content -->
1914 <field name = "content type" type = "shortstr">
1917 <field name = "content encoding" type = "shortstr">
1918 MIME content encoding
1920 <field name = "headers" type = "table">
1921 Message header field table
1923 <field name = "delivery mode" type = "octet">
1924 Non-persistent (1) or persistent (2)
1926 <field name = "priority" type = "octet">
1927 The message priority, 0 to 9
1929 <field name = "correlation id" type = "shortstr">
1930 The application correlation identifier
1932 <field name = "reply to" type = "shortstr">
1933 The destination to reply to
1935 <field name = "expiration" type = "shortstr">
1936 Message expiration specification
1938 <field name = "message id" type = "shortstr">
1939 The application message identifier
1941 <field name = "timestamp" type = "timestamp">
1942 The message timestamp
1944 <field name = "type" type = "shortstr">
1945 The message type name
1947 <field name = "user id" type = "shortstr">
1948 The creating user id
1950 <field name = "app id" type = "shortstr">
1951 The creating application id
1953 <field name = "cluster id" type = "shortstr">
1954 Intra-cluster routing identifier
1958 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
1960 <method name = "qos" synchronous = "1" index = "10">
1961 specify quality of service
1963 This method requests a specific quality of service. The QoS can
1964 be specified for the current channel or for all channels on the
1965 connection. The particular properties and semantics of a qos method
1966 always depend on the content class semantics. Though the qos method
1967 could in principle apply to both peers, it is currently meaningful
1968 only for the server.
1970 <chassis name = "server" implement = "MUST" />
1971 <response name = "qos-ok" />
1973 <field name = "prefetch size" type = "long">
1974 prefetch window in octets
1976 The client can request that messages be sent in advance so that
1977 when the client finishes processing a message, the following
1978 message is already held locally, rather than needing to be sent
1979 down the channel. Prefetching gives a performance improvement.
1980 This field specifies the prefetch window size in octets. The
1981 server will send a message in advance if it is equal to or
1982 smaller in size than the available prefetch size (and also falls
1983 into other prefetch limits). May be set to zero, meaning "no
1984 specific limit", although other prefetch limits may still apply.
1985 The prefetch-size is ignored if the no-ack option is set.
1987 <doc name = "rule" test = "amq_basic_17">
1988 The server MUST ignore this setting when the client is not
1989 processing any messages - i.e. the prefetch size does not limit
1990 the transfer of single messages to a client, only the sending in
1991 advance of more messages while the client still has one or more
1992 unacknowledged messages.
1996 <field name = "prefetch count" type = "short">
1997 prefetch window in messages
1999 Specifies a prefetch window in terms of whole messages. This
2000 field may be used in combination with the prefetch-size field;
2001 a message will only be sent in advance if both prefetch windows
2002 (and those at the channel and connection level) allow it.
2003 The prefetch-count is ignored if the no-ack option is set.
2005 <doc name = "rule" test = "amq_basic_18">
2006 The server MAY send less data in advance than allowed by the
2007 client's specified prefetch windows but it MUST NOT send more.
2011 <field name = "global" type = "bit">
2012 apply to entire connection
2014 By default the QoS settings apply to the current channel only. If
2015 this field is set, they are applied to the entire connection.
2020 <method name = "qos-ok" synchronous = "1" index = "11">
2021 confirm the requested qos
2023 This method tells the client that the requested QoS levels could
2024 be handled by the server. The requested QoS applies to all active
2025 consumers until a new QoS is defined.
2027 <chassis name = "client" implement = "MUST" />
2030 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2032 <method name = "consume" synchronous = "1" index = "20">
2033 start a queue consumer
2035 This method asks the server to start a "consumer", which is a
2036 transient request for messages from a specific queue. Consumers
2037 last as long as the channel they were created on, or until the
2038 client cancels them.
2040 <doc name = "rule" test = "amq_basic_01">
2041 The server SHOULD support at least 16 consumers per queue, unless
2042 the queue was declared as private, and ideally, impose no limit
2043 except as defined by available resources.
2045 <chassis name = "server" implement = "MUST" />
2046 <response name = "consume-ok" />
2048 <field name = "ticket" domain = "access ticket">
2050 The client MUST provide a valid access ticket giving "read" access
2051 rights to the realm for the queue.
2055 <field name = "queue" domain = "queue name">
2057 Specifies the name of the queue to consume from. If the queue name
2058 is null, refers to the current queue for the channel, which is the
2059 last declared queue.
2062 If the client did not previously declare a queue, and the queue name
2063 in this method is empty, the server MUST raise a connection exception
2064 with reply code 530 (not allowed).
2068 <field name = "consumer tag" domain = "consumer tag">
2070 Specifies the identifier for the consumer. The consumer tag is
2071 local to a connection, so two clients can use the same consumer
2072 tags. If this field is empty the server will generate a unique
2075 <doc name = "rule" test = "todo">
2076 The tag MUST NOT refer to an existing consumer. If the client
2077 attempts to create two consumers with the same non-empty tag
2078 the server MUST raise a connection exception with reply code
2083 <field name = "no local" domain = "no local" />
2085 <field name = "no ack" domain = "no ack" />
2087 <field name = "exclusive" type = "bit">
2088 request exclusive access
2090 Request exclusive consumer access, meaning only this consumer can
2093 <doc name = "rule" test = "amq_basic_02">
2094 If the server cannot grant exclusive access to the queue when asked,
2095 - because there are other consumers active - it MUST raise a channel
2096 exception with return code 403 (access refused).
2100 <field name = "nowait" type = "bit">
2101 do not send a reply method
2103 If set, the server will not respond to the method. The client should
2104 not wait for a reply method. If the server could not complete the
2105 method it will raise a channel or connection exception.
2109 <field name="arguments" type="table" label="arguments for consuming">
2111 A set of arguments for the consume. The syntax and semantics
2112 of these arguments depends on the server implementation. This
2113 field is ignored if passive is 1.
2118 <method name = "consume-ok" synchronous = "1" index = "21">
2119 confirm a new consumer
2121 The server provides the client with a consumer tag, which is used
2122 by the client for methods called on the consumer at a later stage.
2124 <chassis name = "client" implement = "MUST" />
2126 <field name = "consumer tag" domain = "consumer tag">
2128 Holds the consumer tag specified by the client or provided by
2135 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2137 <method name = "cancel" synchronous = "1" index = "30">
2138 end a queue consumer
2139 <doc test = "amq_basic_04">
2140 This method cancels a consumer. This does not affect already
2141 delivered messages, but it does mean the server will not send any
2142 more messages for that consumer. The client may receive an
2143 abitrary number of messages in between sending the cancel method
2144 and receiving the cancel-ok reply.
2146 <doc name = "rule" test = "todo">
2147 If the queue no longer exists when the client sends a cancel command,
2148 or the consumer has been cancelled for other reasons, this command
2151 <chassis name = "server" implement = "MUST" />
2152 <response name = "cancel-ok" />
2154 <field name = "consumer tag" domain = "consumer tag" />
2156 <field name = "nowait" type = "bit">
2157 do not send a reply method
2159 If set, the server will not respond to the method. The client should
2160 not wait for a reply method. If the server could not complete the
2161 method it will raise a channel or connection exception.
2166 <method name = "cancel-ok" synchronous = "1" index = "31">
2167 confirm a cancelled consumer
2169 This method confirms that the cancellation was completed.
2171 <chassis name = "client" implement = "MUST" />
2173 <field name = "consumer tag" domain = "consumer tag" />
2177 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2179 <method name = "publish" content = "1" index = "40">
2182 This method publishes a message to a specific exchange. The message
2183 will be routed to queues as defined by the exchange configuration
2184 and distributed to any active consumers when the transaction, if any,
2187 <chassis name = "server" implement = "MUST" />
2189 <field name = "ticket" domain = "access ticket">
2191 The client MUST provide a valid access ticket giving "write"
2192 access rights to the access realm for the exchange.
2196 <field name = "exchange" domain = "exchange name">
2198 Specifies the name of the exchange to publish to. The exchange
2199 name can be empty, meaning the default exchange. If the exchange
2200 name is specified, and that exchange does not exist, the server
2201 will raise a channel exception.
2203 <doc name = "rule" test = "amq_basic_06">
2204 The server MUST accept a blank exchange name to mean the default
2207 <doc name = "rule" test = "amq_basic_14">
2208 If the exchange was declared as an internal exchange, the server
2209 MUST raise a channel exception with a reply code 403 (access
2212 <doc name = "rule" test = "amq_basic_15">
2213 The exchange MAY refuse basic content in which case it MUST raise
2214 a channel exception with reply code 540 (not implemented).
2218 <field name = "routing key" type = "shortstr">
2221 Specifies the routing key for the message. The routing key is
2222 used for routing messages depending on the exchange configuration.
2226 <field name = "mandatory" type = "bit">
2227 indicate mandatory routing
2229 This flag tells the server how to react if the message cannot be
2230 routed to a queue. If this flag is set, the server will return an
2231 unroutable message with a Return method. If this flag is zero, the
2232 server silently drops the message.
2234 <doc name = "rule" test = "amq_basic_07">
2235 The server SHOULD implement the mandatory flag.
2239 <field name = "immediate" type = "bit">
2240 request immediate delivery
2242 This flag tells the server how to react if the message cannot be
2243 routed to a queue consumer immediately. If this flag is set, the
2244 server will return an undeliverable message with a Return method.
2245 If this flag is zero, the server will queue the message, but with
2246 no guarantee that it will ever be consumed.
2248 <doc name = "rule" test = "amq_basic_16">
2249 The server SHOULD implement the immediate flag.
2254 <method name = "return" content = "1" index = "50">
2255 return a failed message
2257 This method returns an undeliverable message that was published
2258 with the "immediate" flag set, or an unroutable message published
2259 with the "mandatory" flag set. The reply code and text provide
2260 information about the reason that the message was undeliverable.
2262 <chassis name = "client" implement = "MUST" />
2264 <field name = "reply code" domain = "reply code" />
2265 <field name = "reply text" domain = "reply text" />
2267 <field name = "exchange" domain = "exchange name">
2269 Specifies the name of the exchange that the message was
2270 originally published to.
2274 <field name = "routing key" type = "shortstr">
2277 Specifies the routing key name specified when the message was
2284 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2286 <method name = "deliver" content = "1" index = "60">
2287 notify the client of a consumer message
2289 This method delivers a message to the client, via a consumer. In
2290 the asynchronous message delivery model, the client starts a
2291 consumer using the Consume method, then the server responds with
2292 Deliver methods as and when messages arrive for that consumer.
2294 <doc name = "rule" test = "amq_basic_19">
2295 The server SHOULD track the number of times a message has been
2296 delivered to clients and when a message is redelivered a certain
2297 number of times - e.g. 5 times - without being acknowledged, the
2298 server SHOULD consider the message to be unprocessable (possibly
2299 causing client applications to abort), and move the message to a
2302 <chassis name = "client" implement = "MUST" />
2304 <field name = "consumer tag" domain = "consumer tag" />
2306 <field name = "delivery tag" domain = "delivery tag" />
2308 <field name = "redelivered" domain = "redelivered" />
2310 <field name = "exchange" domain = "exchange name">
2312 Specifies the name of the exchange that the message was
2313 originally published to.
2317 <field name = "routing key" type = "shortstr">
2320 Specifies the routing key name specified when the message was
2327 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2329 <method name = "get" synchronous = "1" index = "70">
2330 direct access to a queue
2332 This method provides a direct access to the messages in a queue
2333 using a synchronous dialogue that is designed for specific types of
2334 application where synchronous functionality is more important than
2337 <response name = "get-ok" />
2338 <response name = "get-empty" />
2339 <chassis name = "server" implement = "MUST" />
2341 <field name = "ticket" domain = "access ticket">
2343 The client MUST provide a valid access ticket giving "read"
2344 access rights to the realm for the queue.
2348 <field name = "queue" domain = "queue name">
2350 Specifies the name of the queue to consume from. If the queue name
2351 is null, refers to the current queue for the channel, which is the
2352 last declared queue.
2355 If the client did not previously declare a queue, and the queue name
2356 in this method is empty, the server MUST raise a connection exception
2357 with reply code 530 (not allowed).
2361 <field name = "no ack" domain = "no ack" />
2364 <method name = "get-ok" synchronous = "1" content = "1" index = "71">
2365 provide client with a message
2367 This method delivers a message to the client following a get
2368 method. A message delivered by 'get-ok' must be acknowledged
2369 unless the no-ack option was set in the get method.
2371 <chassis name = "client" implement = "MAY" />
2373 <field name = "delivery tag" domain = "delivery tag" />
2375 <field name = "redelivered" domain = "redelivered" />
2377 <field name = "exchange" domain = "exchange name">
2379 Specifies the name of the exchange that the message was originally
2380 published to. If empty, the message was published to the default
2385 <field name = "routing key" type = "shortstr">
2388 Specifies the routing key name specified when the message was
2393 <field name = "message count" type = "long" >
2394 number of messages pending
2396 This field reports the number of messages pending on the queue,
2397 excluding the message being delivered. Note that this figure is
2398 indicative, not reliable, and can change arbitrarily as messages
2399 are added to the queue and removed by other clients.
2405 <method name = "get-empty" synchronous = "1" index = "72">
2406 indicate no messages available
2408 This method tells the client that the queue has no messages
2409 available for the client.
2411 <chassis name = "client" implement = "MAY" />
2413 <field name = "cluster id" type = "shortstr">
2416 For use by cluster applications, should not be used by
2417 client applications.
2422 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2424 <method name = "ack" index = "80">
2425 acknowledge one or more messages
2427 This method acknowledges one or more messages delivered via the
2428 Deliver or Get-Ok methods. The client can ask to confirm a
2429 single message or a set of messages up to and including a specific
2432 <chassis name = "server" implement = "MUST" />
2433 <field name = "delivery tag" domain = "delivery tag" />
2435 <field name = "multiple" type = "bit">
2436 acknowledge multiple messages
2438 If set to 1, the delivery tag is treated as "up to and including",
2439 so that the client can acknowledge multiple messages with a single
2440 method. If set to zero, the delivery tag refers to a single
2441 message. If the multiple field is 1, and the delivery tag is zero,
2442 tells the server to acknowledge all outstanding mesages.
2444 <doc name = "rule" test = "amq_basic_20">
2445 The server MUST validate that a non-zero delivery-tag refers to an
2446 delivered message, and raise a channel exception if this is not the
2452 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2454 <method name = "reject" index = "90">
2455 reject an incoming message
2457 This method allows a client to reject a message. It can be used to
2458 interrupt and cancel large incoming messages, or return untreatable
2459 messages to their original queue.
2461 <doc name = "rule" test = "amq_basic_21">
2462 The server SHOULD be capable of accepting and process the Reject
2463 method while sending message content with a Deliver or Get-Ok
2464 method. I.e. the server should read and process incoming methods
2465 while sending output frames. To cancel a partially-send content,
2466 the server sends a content body frame of size 1 (i.e. with no data
2467 except the frame-end octet).
2469 <doc name = "rule" test = "amq_basic_22">
2470 The server SHOULD interpret this method as meaning that the client
2471 is unable to process the message at this time.
2474 A client MUST NOT use this method as a means of selecting messages
2475 to process. A rejected message MAY be discarded or dead-lettered,
2476 not necessarily passed to another client.
2478 <chassis name = "server" implement = "MUST" />
2480 <field name = "delivery tag" domain = "delivery tag" />
2482 <field name = "requeue" type = "bit">
2485 If this field is zero, the message will be discarded. If this bit
2486 is 1, the server will attempt to requeue the message.
2488 <doc name = "rule" test = "amq_basic_23">
2489 The server MUST NOT deliver the message to the same client within
2490 the context of the current channel. The recommended strategy is
2491 to attempt to deliver the message to an alternative consumer, and
2492 if that is not possible, to move the message to a dead-letter
2493 queue. The server MAY use more sophisticated tracking to hold
2494 the message on the queue and redeliver it to the same client at
2500 <method name = "recover" index = "100">
2501 redeliver unacknowledged messages
2503 This method asks the broker to redeliver all unacknowledged messages on a
2504 specified channel. Zero or more messages may be redelivered. This method
2505 is only allowed on non-transacted channels.
2507 <chassis name = "server" implement = "MUST" />
2509 <field name = "requeue" type = "bit">
2512 If this field is zero, the message will be redelivered to the original
2513 recipient. If this bit is 1, the server will attempt to requeue the
2514 message, potentially then delivering it to an alternative subscriber.
2518 The server MUST set the redelivered flag on all messages that are resent.
2521 The server MUST raise a channel exception if this is called on a
2524 <response name="recover-ok"/>
2526 <method name="recover-ok" synchronous="1" index="101">
2527 confirm a successful recover
2529 This method confirms to the client that the recover succeeded.
2530 Note that if an recover fails, the server raises a channel exception.
2532 <chassis name="client" implement="MUST"/>
2538 <class name="file" handler="channel" index="70">
2540 ======================================================
2542 ======================================================
2544 work with file content
2546 The file class provides methods that support reliable file transfer.
2547 File messages have a specific set of properties that are required for
2548 interoperability with file transfer applications. File messages and
2549 acknowledgements are subject to channel transactions. Note that the
2550 file class does not provide message browsing methods; these are not
2551 compatible with the staging model. Applications that need browsable
2552 file transfer should use Basic content and the Basic class.
2555 <doc name = "grammar">
2556 file = C:QOS S:QOS-OK
2557 / C:CONSUME S:CONSUME-OK
2558 / C:CANCEL S:CANCEL-OK
2559 / C:OPEN S:OPEN-OK C:STAGE content
2560 / S:OPEN C:OPEN-OK S:STAGE content
2568 <chassis name = "server" implement = "MAY" />
2569 <chassis name = "client" implement = "MAY" />
2572 The server MUST make a best-effort to hold file messages on a
2573 reliable storage mechanism.
2576 The server MUST NOT discard a file message in case of a queue
2577 overflow. The server MUST use the Channel.Flow method to slow or stop
2578 a file message publisher when necessary.
2581 The server MUST implement at least 2 priority levels for file
2582 messages, where priorities 0-4 and 5-9 are treated as two distinct
2583 levels. The server MAY implement up to 10 priority levels.
2586 The server MUST support both automatic and explicit acknowledgements
2590 <!-- These are the properties for a File content -->
2592 <field name = "content type" type = "shortstr">
2595 <field name = "content encoding" type = "shortstr">
2596 MIME content encoding
2598 <field name = "headers" type = "table">
2599 Message header field table
2601 <field name = "priority" type = "octet">
2602 The message priority, 0 to 9
2604 <field name = "reply to" type = "shortstr">
2605 The destination to reply to
2607 <field name = "message id" type = "shortstr">
2608 The application message identifier
2610 <field name = "filename" type = "shortstr">
2611 The message filename
2613 <field name = "timestamp" type = "timestamp">
2614 The message timestamp
2616 <field name = "cluster id" type = "shortstr">
2617 Intra-cluster routing identifier
2621 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2623 <method name = "qos" synchronous = "1" index = "10">
2624 specify quality of service
2626 This method requests a specific quality of service. The QoS can
2627 be specified for the current channel or for all channels on the
2628 connection. The particular properties and semantics of a qos method
2629 always depend on the content class semantics. Though the qos method
2630 could in principle apply to both peers, it is currently meaningful
2631 only for the server.
2633 <chassis name = "server" implement = "MUST" />
2634 <response name = "qos-ok" />
2636 <field name = "prefetch size" type = "long">
2637 prefetch window in octets
2639 The client can request that messages be sent in advance so that
2640 when the client finishes processing a message, the following
2641 message is already held locally, rather than needing to be sent
2642 down the channel. Prefetching gives a performance improvement.
2643 This field specifies the prefetch window size in octets. May be
2644 set to zero, meaning "no specific limit". Note that other
2645 prefetch limits may still apply. The prefetch-size is ignored
2646 if the no-ack option is set.
2650 <field name = "prefetch count" type = "short">
2651 prefetch window in messages
2653 Specifies a prefetch window in terms of whole messages. This
2654 is compatible with some file API implementations. This field
2655 may be used in combination with the prefetch-size field; a
2656 message will only be sent in advance if both prefetch windows
2657 (and those at the channel and connection level) allow it.
2658 The prefetch-count is ignored if the no-ack option is set.
2661 The server MAY send less data in advance than allowed by the
2662 client's specified prefetch windows but it MUST NOT send more.
2666 <field name = "global" type = "bit">
2667 apply to entire connection
2669 By default the QoS settings apply to the current channel only. If
2670 this field is set, they are applied to the entire connection.
2675 <method name = "qos-ok" synchronous = "1" index = "11">
2676 confirm the requested qos
2678 This method tells the client that the requested QoS levels could
2679 be handled by the server. The requested QoS applies to all active
2680 consumers until a new QoS is defined.
2682 <chassis name = "client" implement = "MUST" />
2685 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2687 <method name = "consume" synchronous = "1" index = "20">
2688 start a queue consumer
2690 This method asks the server to start a "consumer", which is a
2691 transient request for messages from a specific queue. Consumers
2692 last as long as the channel they were created on, or until the
2693 client cancels them.
2696 The server SHOULD support at least 16 consumers per queue, unless
2697 the queue was declared as private, and ideally, impose no limit
2698 except as defined by available resources.
2700 <chassis name = "server" implement = "MUST" />
2701 <response name = "consume-ok" />
2703 <field name = "ticket" domain = "access ticket">
2705 The client MUST provide a valid access ticket giving "read" access
2706 rights to the realm for the queue.
2710 <field name = "queue" domain = "queue name">
2712 Specifies the name of the queue to consume from. If the queue name
2713 is null, refers to the current queue for the channel, which is the
2714 last declared queue.
2717 If the client did not previously declare a queue, and the queue name
2718 in this method is empty, the server MUST raise a connection exception
2719 with reply code 530 (not allowed).
2723 <field name = "consumer tag" domain = "consumer tag">
2725 Specifies the identifier for the consumer. The consumer tag is
2726 local to a connection, so two clients can use the same consumer
2727 tags. If this field is empty the server will generate a unique
2730 <doc name = "rule" test = "todo">
2731 The tag MUST NOT refer to an existing consumer. If the client
2732 attempts to create two consumers with the same non-empty tag
2733 the server MUST raise a connection exception with reply code
2738 <field name = "no local" domain = "no local" />
2740 <field name = "no ack" domain = "no ack" />
2742 <field name = "exclusive" type = "bit">
2743 request exclusive access
2745 Request exclusive consumer access, meaning only this consumer can
2748 <doc name = "rule" test = "amq_file_00">
2749 If the server cannot grant exclusive access to the queue when asked,
2750 - because there are other consumers active - it MUST raise a channel
2751 exception with return code 405 (resource locked).
2755 <field name = "nowait" type = "bit">
2756 do not send a reply method
2758 If set, the server will not respond to the method. The client should
2759 not wait for a reply method. If the server could not complete the
2760 method it will raise a channel or connection exception.
2765 <method name = "consume-ok" synchronous = "1" index = "21">
2766 confirm a new consumer
2768 This method provides the client with a consumer tag which it MUST
2769 use in methods that work with the consumer.
2771 <chassis name = "client" implement = "MUST" />
2773 <field name = "consumer tag" domain = "consumer tag">
2775 Holds the consumer tag specified by the client or provided by
2782 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2784 <method name = "cancel" synchronous = "1" index = "30">
2785 end a queue consumer
2787 This method cancels a consumer. This does not affect already
2788 delivered messages, but it does mean the server will not send any
2789 more messages for that consumer.
2791 <chassis name = "server" implement = "MUST" />
2792 <response name = "cancel-ok" />
2794 <field name = "consumer tag" domain = "consumer tag" />
2796 <field name = "nowait" type = "bit">
2797 do not send a reply method
2799 If set, the server will not respond to the method. The client should
2800 not wait for a reply method. If the server could not complete the
2801 method it will raise a channel or connection exception.
2806 <method name = "cancel-ok" synchronous = "1" index = "31">
2807 confirm a cancelled consumer
2809 This method confirms that the cancellation was completed.
2811 <chassis name = "client" implement = "MUST" />
2813 <field name = "consumer tag" domain = "consumer tag" />
2817 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2819 <method name = "open" synchronous = "1" index = "40">
2820 request to start staging
2822 This method requests permission to start staging a message. Staging
2823 means sending the message into a temporary area at the recipient end
2824 and then delivering the message by referring to this temporary area.
2825 Staging is how the protocol handles partial file transfers - if a
2826 message is partially staged and the connection breaks, the next time
2827 the sender starts to stage it, it can restart from where it left off.
2829 <response name = "open-ok" />
2830 <chassis name = "server" implement = "MUST" />
2831 <chassis name = "client" implement = "MUST" />
2833 <field name = "identifier" type = "shortstr">
2836 This is the staging identifier. This is an arbitrary string chosen
2837 by the sender. For staging to work correctly the sender must use
2838 the same staging identifier when staging the same message a second
2839 time after recovery from a failure. A good choice for the staging
2840 identifier would be the SHA1 hash of the message properties data
2841 (including the original filename, revised time, etc.).
2845 <field name = "content size" type = "longlong">
2846 message content size
2848 The size of the content in octets. The recipient may use this
2849 information to allocate or check available space in advance, to
2850 avoid "disk full" errors during staging of very large messages.
2853 The sender MUST accurately fill the content-size field.
2854 Zero-length content is permitted.
2859 <method name = "open-ok" synchronous = "1" index = "41">
2860 confirm staging ready
2862 This method confirms that the recipient is ready to accept staged
2863 data. If the message was already partially-staged at a previous
2864 time the recipient will report the number of octets already staged.
2866 <response name = "stage" />
2867 <chassis name = "server" implement = "MUST" />
2868 <chassis name = "client" implement = "MUST" />
2870 <field name = "staged size" type = "longlong">
2871 already staged amount
2873 The amount of previously-staged content in octets. For a new
2874 message this will be zero.
2877 The sender MUST start sending data from this octet offset in the
2878 message, counting from zero.
2881 The recipient MAY decide how long to hold partially-staged content
2882 and MAY implement staging by always discarding partially-staged
2883 content. However if it uses the file content type it MUST support
2884 the staging methods.
2889 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2891 <method name = "stage" content = "1" index = "50">
2892 stage message content
2894 This method stages the message, sending the message content to the
2895 recipient from the octet offset specified in the Open-Ok method.
2897 <chassis name = "server" implement = "MUST" />
2898 <chassis name = "client" implement = "MUST" />
2902 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2904 <method name = "publish" index = "60">
2907 This method publishes a staged file message to a specific exchange.
2908 The file message will be routed to queues as defined by the exchange
2909 configuration and distributed to any active consumers when the
2910 transaction, if any, is committed.
2912 <chassis name = "server" implement = "MUST" />
2914 <field name = "ticket" domain = "access ticket">
2916 The client MUST provide a valid access ticket giving "write"
2917 access rights to the access realm for the exchange.
2921 <field name = "exchange" domain = "exchange name">
2923 Specifies the name of the exchange to publish to. The exchange
2924 name can be empty, meaning the default exchange. If the exchange
2925 name is specified, and that exchange does not exist, the server
2926 will raise a channel exception.
2929 The server MUST accept a blank exchange name to mean the default
2933 If the exchange was declared as an internal exchange, the server
2934 MUST respond with a reply code 403 (access refused) and raise a
2938 The exchange MAY refuse file content in which case it MUST respond
2939 with a reply code 540 (not implemented) and raise a channel
2944 <field name = "routing key" type = "shortstr">
2947 Specifies the routing key for the message. The routing key is
2948 used for routing messages depending on the exchange configuration.
2952 <field name = "mandatory" type = "bit">
2953 indicate mandatory routing
2955 This flag tells the server how to react if the message cannot be
2956 routed to a queue. If this flag is set, the server will return an
2957 unroutable message with a Return method. If this flag is zero, the
2958 server silently drops the message.
2960 <doc name = "rule" test = "amq_file_00">
2961 The server SHOULD implement the mandatory flag.
2965 <field name = "immediate" type = "bit">
2966 request immediate delivery
2968 This flag tells the server how to react if the message cannot be
2969 routed to a queue consumer immediately. If this flag is set, the
2970 server will return an undeliverable message with a Return method.
2971 If this flag is zero, the server will queue the message, but with
2972 no guarantee that it will ever be consumed.
2974 <doc name = "rule" test = "amq_file_00">
2975 The server SHOULD implement the immediate flag.
2979 <field name = "identifier" type = "shortstr">
2982 This is the staging identifier of the message to publish. The
2983 message must have been staged. Note that a client can send the
2984 Publish method asynchronously without waiting for staging to
2990 <method name = "return" content = "1" index = "70">
2991 return a failed message
2993 This method returns an undeliverable message that was published
2994 with the "immediate" flag set, or an unroutable message published
2995 with the "mandatory" flag set. The reply code and text provide
2996 information about the reason that the message was undeliverable.
2998 <chassis name = "client" implement = "MUST" />
3000 <field name = "reply code" domain = "reply code" />
3001 <field name = "reply text" domain = "reply text" />
3003 <field name = "exchange" domain = "exchange name">
3005 Specifies the name of the exchange that the message was
3006 originally published to.
3010 <field name = "routing key" type = "shortstr">
3013 Specifies the routing key name specified when the message was
3020 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3022 <method name = "deliver" index = "80">
3023 notify the client of a consumer message
3025 This method delivers a staged file message to the client, via a
3026 consumer. In the asynchronous message delivery model, the client
3027 starts a consumer using the Consume method, then the server
3028 responds with Deliver methods as and when messages arrive for
3032 The server SHOULD track the number of times a message has been
3033 delivered to clients and when a message is redelivered a certain
3034 number of times - e.g. 5 times - without being acknowledged, the
3035 server SHOULD consider the message to be unprocessable (possibly
3036 causing client applications to abort), and move the message to a
3039 <chassis name = "client" implement = "MUST" />
3041 <field name = "consumer tag" domain = "consumer tag" />
3043 <field name = "delivery tag" domain = "delivery tag" />
3045 <field name = "redelivered" domain = "redelivered" />
3047 <field name = "exchange" domain = "exchange name">
3049 Specifies the name of the exchange that the message was originally
3054 <field name = "routing key" type = "shortstr">
3057 Specifies the routing key name specified when the message was
3062 <field name = "identifier" type = "shortstr">
3065 This is the staging identifier of the message to deliver. The
3066 message must have been staged. Note that a server can send the
3067 Deliver method asynchronously without waiting for staging to
3074 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3076 <method name = "ack" index = "90">
3077 acknowledge one or more messages
3079 This method acknowledges one or more messages delivered via the
3080 Deliver method. The client can ask to confirm a single message or
3081 a set of messages up to and including a specific message.
3083 <chassis name = "server" implement = "MUST" />
3084 <field name = "delivery tag" domain = "delivery tag" />
3086 <field name = "multiple" type = "bit">
3087 acknowledge multiple messages
3089 If set to 1, the delivery tag is treated as "up to and including",
3090 so that the client can acknowledge multiple messages with a single
3091 method. If set to zero, the delivery tag refers to a single
3092 message. If the multiple field is 1, and the delivery tag is zero,
3093 tells the server to acknowledge all outstanding mesages.
3096 The server MUST validate that a non-zero delivery-tag refers to an
3097 delivered message, and raise a channel exception if this is not the
3104 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3106 <method name = "reject" index = "100">
3107 reject an incoming message
3109 This method allows a client to reject a message. It can be used to
3110 return untreatable messages to their original queue. Note that file
3111 content is staged before delivery, so the client will not use this
3112 method to interrupt delivery of a large message.
3115 The server SHOULD interpret this method as meaning that the client
3116 is unable to process the message at this time.
3119 A client MUST NOT use this method as a means of selecting messages
3120 to process. A rejected message MAY be discarded or dead-lettered,
3121 not necessarily passed to another client.
3123 <chassis name = "server" implement = "MUST" />
3125 <field name = "delivery tag" domain = "delivery tag" />
3127 <field name = "requeue" type = "bit">
3130 If this field is zero, the message will be discarded. If this bit
3131 is 1, the server will attempt to requeue the message.
3134 The server MUST NOT deliver the message to the same client within
3135 the context of the current channel. The recommended strategy is
3136 to attempt to deliver the message to an alternative consumer, and
3137 if that is not possible, to move the message to a dead-letter
3138 queue. The server MAY use more sophisticated tracking to hold
3139 the message on the queue and redeliver it to the same client at
3147 <class name="stream" handler="channel" index="80">
3149 ======================================================
3151 ======================================================
3153 work with streaming content
3156 The stream class provides methods that support multimedia streaming.
3157 The stream class uses the following semantics: one message is one
3158 packet of data; delivery is unacknowleged and unreliable; the consumer
3159 can specify quality of service parameters that the server can try to
3160 adhere to; lower-priority messages may be discarded in favour of high
3164 <doc name = "grammar">
3165 stream = C:QOS S:QOS-OK
3166 / C:CONSUME S:CONSUME-OK
3167 / C:CANCEL S:CANCEL-OK
3173 <chassis name = "server" implement = "MAY" />
3174 <chassis name = "client" implement = "MAY" />
3177 The server SHOULD discard stream messages on a priority basis if
3178 the queue size exceeds some configured limit.
3181 The server MUST implement at least 2 priority levels for stream
3182 messages, where priorities 0-4 and 5-9 are treated as two distinct
3183 levels. The server MAY implement up to 10 priority levels.
3186 The server MUST implement automatic acknowledgements on stream
3187 content. That is, as soon as a message is delivered to a client
3188 via a Deliver method, the server must remove it from the queue.
3192 <!-- These are the properties for a Stream content -->
3194 <field name = "content type" type = "shortstr">
3197 <field name = "content encoding" type = "shortstr">
3198 MIME content encoding
3200 <field name = "headers" type = "table">
3201 Message header field table
3203 <field name = "priority" type = "octet">
3204 The message priority, 0 to 9
3206 <field name = "timestamp" type = "timestamp">
3207 The message timestamp
3211 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3213 <method name = "qos" synchronous = "1" index = "10">
3214 specify quality of service
3216 This method requests a specific quality of service. The QoS can
3217 be specified for the current channel or for all channels on the
3218 connection. The particular properties and semantics of a qos method
3219 always depend on the content class semantics. Though the qos method
3220 could in principle apply to both peers, it is currently meaningful
3221 only for the server.
3223 <chassis name = "server" implement = "MUST" />
3224 <response name = "qos-ok" />
3226 <field name = "prefetch size" type = "long">
3227 prefetch window in octets
3229 The client can request that messages be sent in advance so that
3230 when the client finishes processing a message, the following
3231 message is already held locally, rather than needing to be sent
3232 down the channel. Prefetching gives a performance improvement.
3233 This field specifies the prefetch window size in octets. May be
3234 set to zero, meaning "no specific limit". Note that other
3235 prefetch limits may still apply.
3239 <field name = "prefetch count" type = "short">
3240 prefetch window in messages
3242 Specifies a prefetch window in terms of whole messages. This
3243 field may be used in combination with the prefetch-size field;
3244 a message will only be sent in advance if both prefetch windows
3245 (and those at the channel and connection level) allow it.
3249 <field name = "consume rate" type = "long">
3250 transfer rate in octets/second
3252 Specifies a desired transfer rate in octets per second. This is
3253 usually determined by the application that uses the streaming
3254 data. A value of zero means "no limit", i.e. as rapidly as
3258 The server MAY ignore the prefetch values and consume rates,
3259 depending on the type of stream and the ability of the server
3260 to queue and/or reply it. The server MAY drop low-priority
3261 messages in favour of high-priority messages.
3265 <field name = "global" type = "bit">
3266 apply to entire connection
3268 By default the QoS settings apply to the current channel only. If
3269 this field is set, they are applied to the entire connection.
3274 <method name = "qos-ok" synchronous = "1" index = "11">
3275 confirm the requested qos
3277 This method tells the client that the requested QoS levels could
3278 be handled by the server. The requested QoS applies to all active
3279 consumers until a new QoS is defined.
3281 <chassis name = "client" implement = "MUST" />
3284 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3286 <method name = "consume" synchronous = "1" index = "20">
3287 start a queue consumer
3289 This method asks the server to start a "consumer", which is a
3290 transient request for messages from a specific queue. Consumers
3291 last as long as the channel they were created on, or until the
3292 client cancels them.
3295 The server SHOULD support at least 16 consumers per queue, unless
3296 the queue was declared as private, and ideally, impose no limit
3297 except as defined by available resources.
3300 Streaming applications SHOULD use different channels to select
3301 different streaming resolutions. AMQP makes no provision for
3302 filtering and/or transforming streams except on the basis of
3303 priority-based selective delivery of individual messages.
3305 <chassis name = "server" implement = "MUST" />
3306 <response name = "consume-ok" />
3308 <field name = "ticket" domain = "access ticket">
3310 The client MUST provide a valid access ticket giving "read" access
3311 rights to the realm for the queue.
3315 <field name = "queue" domain = "queue name">
3317 Specifies the name of the queue to consume from. If the queue name
3318 is null, refers to the current queue for the channel, which is the
3319 last declared queue.
3322 If the client did not previously declare a queue, and the queue name
3323 in this method is empty, the server MUST raise a connection exception
3324 with reply code 530 (not allowed).
3328 <field name = "consumer tag" domain = "consumer tag">
3330 Specifies the identifier for the consumer. The consumer tag is
3331 local to a connection, so two clients can use the same consumer
3332 tags. If this field is empty the server will generate a unique
3335 <doc name = "rule" test = "todo">
3336 The tag MUST NOT refer to an existing consumer. If the client
3337 attempts to create two consumers with the same non-empty tag
3338 the server MUST raise a connection exception with reply code
3343 <field name = "no local" domain = "no local" />
3345 <field name = "exclusive" type = "bit">
3346 request exclusive access
3348 Request exclusive consumer access, meaning only this consumer can
3351 <doc name = "rule" test = "amq_file_00">
3352 If the server cannot grant exclusive access to the queue when asked,
3353 - because there are other consumers active - it MUST raise a channel
3354 exception with return code 405 (resource locked).
3358 <field name = "nowait" type = "bit">
3359 do not send a reply method
3361 If set, the server will not respond to the method. The client should
3362 not wait for a reply method. If the server could not complete the
3363 method it will raise a channel or connection exception.
3369 <method name = "consume-ok" synchronous = "1" index = "21">
3370 confirm a new consumer
3372 This method provides the client with a consumer tag which it may
3373 use in methods that work with the consumer.
3375 <chassis name = "client" implement = "MUST" />
3377 <field name = "consumer tag" domain = "consumer tag">
3379 Holds the consumer tag specified by the client or provided by
3385 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3387 <method name = "cancel" synchronous = "1" index = "30">
3388 end a queue consumer
3390 This method cancels a consumer. Since message delivery is
3391 asynchronous the client may continue to receive messages for
3392 a short while after canceling a consumer. It may process or
3393 discard these as appropriate.
3395 <chassis name = "server" implement = "MUST" />
3396 <response name = "cancel-ok" />
3398 <field name = "consumer tag" domain = "consumer tag" />
3400 <field name = "nowait" type = "bit">
3401 do not send a reply method
3403 If set, the server will not respond to the method. The client should
3404 not wait for a reply method. If the server could not complete the
3405 method it will raise a channel or connection exception.
3410 <method name = "cancel-ok" synchronous = "1" index = "31">
3411 confirm a cancelled consumer
3413 This method confirms that the cancellation was completed.
3415 <chassis name = "client" implement = "MUST" />
3417 <field name = "consumer tag" domain = "consumer tag" />
3421 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3423 <method name = "publish" content = "1" index = "40">
3426 This method publishes a message to a specific exchange. The message
3427 will be routed to queues as defined by the exchange configuration
3428 and distributed to any active consumers as appropriate.
3430 <chassis name = "server" implement = "MUST" />
3432 <field name = "ticket" domain = "access ticket">
3434 The client MUST provide a valid access ticket giving "write"
3435 access rights to the access realm for the exchange.
3439 <field name = "exchange" domain = "exchange name">
3441 Specifies the name of the exchange to publish to. The exchange
3442 name can be empty, meaning the default exchange. If the exchange
3443 name is specified, and that exchange does not exist, the server
3444 will raise a channel exception.
3447 The server MUST accept a blank exchange name to mean the default
3451 If the exchange was declared as an internal exchange, the server
3452 MUST respond with a reply code 403 (access refused) and raise a
3456 The exchange MAY refuse stream content in which case it MUST
3457 respond with a reply code 540 (not implemented) and raise a
3462 <field name = "routing key" type = "shortstr">
3465 Specifies the routing key for the message. The routing key is
3466 used for routing messages depending on the exchange configuration.
3470 <field name = "mandatory" type = "bit">
3471 indicate mandatory routing
3473 This flag tells the server how to react if the message cannot be
3474 routed to a queue. If this flag is set, the server will return an
3475 unroutable message with a Return method. If this flag is zero, the
3476 server silently drops the message.
3478 <doc name = "rule" test = "amq_stream_00">
3479 The server SHOULD implement the mandatory flag.
3483 <field name = "immediate" type = "bit">
3484 request immediate delivery
3486 This flag tells the server how to react if the message cannot be
3487 routed to a queue consumer immediately. If this flag is set, the
3488 server will return an undeliverable message with a Return method.
3489 If this flag is zero, the server will queue the message, but with
3490 no guarantee that it will ever be consumed.
3492 <doc name = "rule" test = "amq_stream_00">
3493 The server SHOULD implement the immediate flag.
3498 <method name = "return" content = "1" index = "50">
3499 return a failed message
3501 This method returns an undeliverable message that was published
3502 with the "immediate" flag set, or an unroutable message published
3503 with the "mandatory" flag set. The reply code and text provide
3504 information about the reason that the message was undeliverable.
3506 <chassis name = "client" implement = "MUST" />
3508 <field name = "reply code" domain = "reply code" />
3509 <field name = "reply text" domain = "reply text" />
3511 <field name = "exchange" domain = "exchange name">
3513 Specifies the name of the exchange that the message was
3514 originally published to.
3518 <field name = "routing key" type = "shortstr">
3521 Specifies the routing key name specified when the message was
3528 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3530 <method name = "deliver" content = "1" index = "60">
3531 notify the client of a consumer message
3533 This method delivers a message to the client, via a consumer. In
3534 the asynchronous message delivery model, the client starts a
3535 consumer using the Consume method, then the server responds with
3536 Deliver methods as and when messages arrive for that consumer.
3538 <chassis name = "client" implement = "MUST" />
3540 <field name = "consumer tag" domain = "consumer tag" />
3542 <field name = "delivery tag" domain = "delivery tag" />
3544 <field name = "exchange" domain = "exchange name">
3546 Specifies the name of the exchange that the message was originally
3551 <field name = "queue" domain = "queue name">
3553 Specifies the name of the queue that the message came from. Note
3554 that a single channel can start many consumers on different
3557 <assert check = "notnull" />
3562 <class name="tx" handler="channel" index="90">
3564 ======================================================
3566 ======================================================
3568 work with standard transactions
3571 Standard transactions provide so-called "1.5 phase commit". We can
3572 ensure that work is never lost, but there is a chance of confirmations
3573 being lost, so that messages may be resent. Applications that use
3574 standard transactions must be able to detect and ignore duplicate
3577 <rule implement="SHOULD">
3578 An client using standard transactions SHOULD be able to track all
3579 messages received within a reasonable period, and thus detect and
3580 reject duplicates of the same message. It SHOULD NOT pass these to
3581 the application layer.
3583 <doc name="grammar">
3584 tx = C:SELECT S:SELECT-OK
3585 / C:COMMIT S:COMMIT-OK
3586 / C:ROLLBACK S:ROLLBACK-OK
3588 <chassis name="server" implement="SHOULD"/>
3589 <chassis name="client" implement="MAY"/>
3590 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3591 <method name="select" synchronous="1" index="10">
3592 select standard transaction mode
3594 This method sets the channel to use standard transactions. The
3595 client must use this method at least once on a channel before
3596 using the Commit or Rollback methods.
3598 <chassis name="server" implement="MUST"/>
3599 <response name="select-ok"/>
3601 <method name="select-ok" synchronous="1" index="11">
3602 confirm transaction mode
3604 This method confirms to the client that the channel was successfully
3605 set to use standard transactions.
3607 <chassis name="client" implement="MUST"/>
3609 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3610 <method name="commit" synchronous="1" index="20">
3611 commit the current transaction
3613 This method commits all messages published and acknowledged in
3614 the current transaction. A new transaction starts immediately
3617 <chassis name="server" implement="MUST"/>
3618 <response name="commit-ok"/>
3620 <method name="commit-ok" synchronous="1" index="21">
3621 confirm a successful commit
3623 This method confirms to the client that the commit succeeded.
3624 Note that if a commit fails, the server raises a channel exception.
3626 <chassis name="client" implement="MUST"/>
3628 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3629 <method name="rollback" synchronous="1" index="30">
3630 abandon the current transaction
3632 This method abandons all messages published and acknowledged in
3633 the current transaction. A new transaction starts immediately
3636 <chassis name="server" implement="MUST"/>
3637 <response name="rollback-ok"/>
3639 <method name="rollback-ok" synchronous="1" index="31">
3640 confirm a successful rollback
3642 This method confirms to the client that the rollback succeeded.
3643 Note that if an rollback fails, the server raises a channel exception.
3645 <chassis name="client" implement="MUST"/>
3648 <class name="dtx" handler="channel" index="100">
3650 ======================================================
3651 == DISTRIBUTED TRANSACTIONS
3652 ======================================================
3654 work with distributed transactions
3657 Distributed transactions provide so-called "2-phase commit". The
3658 AMQP distributed transaction model supports the X-Open XA
3659 architecture and other distributed transaction implementations.
3660 The Dtx class assumes that the server has a private communications
3661 channel (not AMQP) to a distributed transaction coordinator.
3663 <doc name="grammar">
3664 dtx = C:SELECT S:SELECT-OK
3667 <chassis name="server" implement="MAY"/>
3668 <chassis name="client" implement="MAY"/>
3669 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3670 <method name="select" synchronous="1" index="10">
3671 select standard transaction mode
3673 This method sets the channel to use distributed transactions. The
3674 client must use this method at least once on a channel before
3675 using the Start method.
3677 <chassis name="server" implement="MUST"/>
3678 <response name="select-ok"/>
3680 <method name="select-ok" synchronous="1" index="11">
3681 confirm transaction mode
3683 This method confirms to the client that the channel was successfully
3684 set to use distributed transactions.
3686 <chassis name="client" implement="MUST"/>
3688 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3689 <method name="start" synchronous="1" index="20">
3690 start a new distributed transaction
3692 This method starts a new distributed transaction. This must be
3693 the first method on a new channel that uses the distributed
3694 transaction mode, before any methods that publish or consume
3697 <chassis name="server" implement="MAY"/>
3698 <response name="start-ok"/>
3699 <field name="dtx identifier" type="shortstr">
3700 transaction identifier
3702 The distributed transaction key. This identifies the transaction
3703 so that the AMQP server can coordinate with the distributed
3704 transaction coordinator.
3706 <assert check="notnull"/>
3709 <method name="start-ok" synchronous="1" index="21">
3710 confirm the start of a new distributed transaction
3712 This method confirms to the client that the transaction started.
3713 Note that if a start fails, the server raises a channel exception.
3715 <chassis name="client" implement="MUST"/>
3718 <class name="tunnel" handler="tunnel" index="110">
3720 ======================================================
3722 ======================================================
3724 methods for protocol tunneling.
3727 The tunnel methods are used to send blocks of binary data - which
3728 can be serialised AMQP methods or other protocol frames - between
3731 <doc name="grammar">
3735 <chassis name="server" implement="MAY"/>
3736 <chassis name="client" implement="MAY"/>
3737 <field name="headers" type="table">
3738 Message header field table
3740 <field name="proxy name" type="shortstr">
3741 The identity of the tunnelling proxy
3743 <field name="data name" type="shortstr">
3744 The name or type of the message being tunnelled
3746 <field name="durable" type="octet">
3747 The message durability indicator
3749 <field name="broadcast" type="octet">
3750 The message broadcast mode
3752 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3753 <method name="request" content="1" index="10">
3754 sends a tunnelled method
3756 This method tunnels a block of binary data, which can be an
3757 encoded AMQP method or other data. The binary data is sent
3758 as the content for the Tunnel.Request method.
3760 <chassis name="server" implement="MUST"/>
3761 <field name="meta data" type="table">
3762 meta data for the tunnelled block
3764 This field table holds arbitrary meta-data that the sender needs
3765 to pass to the recipient.
3770 <class name="test" handler="channel" index="120">
3772 ======================================================
3773 == TEST - CHECK FUNCTIONAL CAPABILITIES OF AN IMPLEMENTATION
3774 ======================================================
3776 test functional primitives of the implementation
3779 The test class provides methods for a peer to test the basic
3780 operational correctness of another peer. The test methods are
3781 intended to ensure that all peers respect at least the basic
3782 elements of the protocol, such as frame and content organisation
3783 and field types. We assume that a specially-designed peer, a
3784 "monitor client" would perform such tests.
3786 <doc name="grammar">
3787 test = C:INTEGER S:INTEGER-OK
3788 / S:INTEGER C:INTEGER-OK
3789 / C:STRING S:STRING-OK
3790 / S:STRING C:STRING-OK
3791 / C:TABLE S:TABLE-OK
3792 / S:TABLE C:TABLE-OK
3793 / C:CONTENT S:CONTENT-OK
3794 / S:CONTENT C:CONTENT-OK
3796 <chassis name="server" implement="MUST"/>
3797 <chassis name="client" implement="SHOULD"/>
3798 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3799 <method name="integer" synchronous="1" index="10">
3800 test integer handling
3802 This method tests the peer's capability to correctly marshal integer
3805 <chassis name="client" implement="MUST"/>
3806 <chassis name="server" implement="MUST"/>
3807 <response name="integer-ok"/>
3808 <field name="integer 1" type="octet">
3811 An octet integer test value.
3814 <field name="integer 2" type="short">
3817 A short integer test value.
3820 <field name="integer 3" type="long">
3823 A long integer test value.
3826 <field name="integer 4" type="longlong">
3827 long-long test value
3829 A long long integer test value.
3832 <field name="operation" type="octet">
3835 The client must execute this operation on the provided integer
3836 test fields and return the result.
3838 <assert check="enum">
3839 <value name="add">return sum of test values</value>
3840 <value name="min">return lowest of test values</value>
3841 <value name="max">return highest of test values</value>
3845 <method name="integer-ok" synchronous="1" index="11">
3846 report integer test result
3848 This method reports the result of an Integer method.
3850 <chassis name="client" implement="MUST"/>
3851 <chassis name="server" implement="MUST"/>
3852 <field name="result" type="longlong">
3855 The result of the tested operation.
3859 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3860 <method name="string" synchronous="1" index="20">
3861 test string handling
3863 This method tests the peer's capability to correctly marshal string
3866 <chassis name="client" implement="MUST"/>
3867 <chassis name="server" implement="MUST"/>
3868 <response name="string-ok"/>
3869 <field name="string 1" type="shortstr">
3870 short string test value
3872 An short string test value.
3875 <field name="string 2" type="longstr">
3876 long string test value
3878 A long string test value.
3881 <field name="operation" type="octet">
3884 The client must execute this operation on the provided string
3885 test fields and return the result.
3887 <assert check="enum">
3888 <value name="add">return concatentation of test strings</value>
3889 <value name="min">return shortest of test strings</value>
3890 <value name="max">return longest of test strings</value>
3894 <method name="string-ok" synchronous="1" index="21">
3895 report string test result
3897 This method reports the result of a String method.
3899 <chassis name="client" implement="MUST"/>
3900 <chassis name="server" implement="MUST"/>
3901 <field name="result" type="longstr">
3904 The result of the tested operation.
3908 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3909 <method name="table" synchronous="1" index="30">
3910 test field table handling
3912 This method tests the peer's capability to correctly marshal field
3915 <chassis name="client" implement="MUST"/>
3916 <chassis name="server" implement="MUST"/>
3917 <response name="table-ok"/>
3918 <field name="table" type="table">
3919 field table of test values
3921 A field table of test values.
3924 <field name="integer op" type="octet">
3925 operation to test on integers
3927 The client must execute this operation on the provided field
3928 table integer values and return the result.
3930 <assert check="enum">
3931 <value name="add">return sum of numeric field values</value>
3932 <value name="min">return min of numeric field values</value>
3933 <value name="max">return max of numeric field values</value>
3936 <field name="string op" type="octet">
3937 operation to test on strings
3939 The client must execute this operation on the provided field
3940 table string values and return the result.
3942 <assert check="enum">
3943 <value name="add">return concatenation of string field values</value>
3944 <value name="min">return shortest of string field values</value>
3945 <value name="max">return longest of string field values</value>
3949 <method name="table-ok" synchronous="1" index="31">
3950 report table test result
3952 This method reports the result of a Table method.
3954 <chassis name="client" implement="MUST"/>
3955 <chassis name="server" implement="MUST"/>
3956 <field name="integer result" type="longlong">
3957 integer result value
3959 The result of the tested integer operation.
3962 <field name="string result" type="longstr">
3965 The result of the tested string operation.
3969 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
3970 <method name="content" synchronous="1" content="1" index="40">
3971 test content handling
3973 This method tests the peer's capability to correctly marshal content.
3975 <chassis name="client" implement="MUST"/>
3976 <chassis name="server" implement="MUST"/>
3977 <response name="content-ok"/>
3979 <method name="content-ok" synchronous="1" content="1" index="41">
3980 report content test result
3982 This method reports the result of a Content method. It contains the
3983 content checksum and echoes the original content as provided.
3985 <chassis name="client" implement="MUST"/>
3986 <chassis name="server" implement="MUST"/>
3987 <field name="content checksum" type="long">
3990 The 32-bit checksum of the content, calculated by adding the
3991 content into a 32-bit accumulator.