| 1 |
<?xml version = "1.0"?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
<amqp major = "0" minor = "9" revision = "1" |
| 144 |
port = "5672" comment = "AMQ Protocol version 0-9-1"> |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
<constant name = "frame-method" value = "1" /> |
| 152 |
<constant name = "frame-header" value = "2" /> |
| 153 |
<constant name = "frame-body" value = "3" /> |
| 154 |
<constant name = "frame-heartbeat" value = "8" /> |
| 155 |
|
| 156 |
|
| 157 |
<constant name = "frame-min-size" value = "4096" /> |
| 158 |
<constant name = "frame-end" value = "206" /> |
| 159 |
|
| 160 |
|
| 161 |
<constant name = "reply-success" value = "200"> |
| 162 |
<doc> |
| 163 |
Indicates that the method completed successfully. This reply code is |
| 164 |
reserved for future use - the current protocol design does not use positive |
| 165 |
confirmation and reply codes are sent only in case of an error. |
| 166 |
</doc> |
| 167 |
</constant> |
| 168 |
|
| 169 |
<constant name = "content-too-large" value = "311" class = "soft-error"> |
| 170 |
<doc> |
| 171 |
The client attempted to transfer content larger than the server could accept |
| 172 |
at the present time. The client may retry at a later time. |
| 173 |
</doc> |
| 174 |
</constant> |
| 175 |
|
| 176 |
<constant name = "no-consumers" value = "313" class = "soft-error"> |
| 177 |
<doc> |
| 178 |
When the exchange cannot deliver to a consumer when the immediate flag is |
| 179 |
set. As a result of pending data on the queue or the absence of any |
| 180 |
consumers of the queue. |
| 181 |
</doc> |
| 182 |
</constant> |
| 183 |
|
| 184 |
<constant name = "connection-forced" value = "320" class = "hard-error"> |
| 185 |
<doc> |
| 186 |
An operator intervened to close the connection for some reason. The client |
| 187 |
may retry at some later date. |
| 188 |
</doc> |
| 189 |
</constant> |
| 190 |
|
| 191 |
<constant name = "invalid-path" value = "402" class = "hard-error"> |
| 192 |
<doc> |
| 193 |
The client tried to work with an unknown virtual host. |
| 194 |
</doc> |
| 195 |
</constant> |
| 196 |
|
| 197 |
<constant name = "access-refused" value = "403" class = "soft-error"> |
| 198 |
<doc> |
| 199 |
The client attempted to work with a server entity to which it has no |
| 200 |
access due to security settings. |
| 201 |
</doc> |
| 202 |
</constant> |
| 203 |
|
| 204 |
<constant name = "not-found" value = "404" class = "soft-error"> |
| 205 |
<doc> |
| 206 |
The client attempted to work with a server entity that does not exist. |
| 207 |
</doc> |
| 208 |
</constant> |
| 209 |
|
| 210 |
<constant name = "resource-locked" value = "405" class = "soft-error"> |
| 211 |
<doc> |
| 212 |
The client attempted to work with a server entity to which it has no |
| 213 |
access because another client is working with it. |
| 214 |
</doc> |
| 215 |
</constant> |
| 216 |
|
| 217 |
<constant name = "precondition-failed" value = "406" class = "soft-error"> |
| 218 |
<doc> |
| 219 |
The client requested a method that was not allowed because some precondition |
| 220 |
failed. |
| 221 |
</doc> |
| 222 |
</constant> |
| 223 |
|
| 224 |
<constant name = "frame-error" value = "501" class = "hard-error"> |
| 225 |
<doc> |
| 226 |
The sender sent a malformed frame that the recipient could not decode. |
| 227 |
This strongly implies a programming error in the sending peer. |
| 228 |
</doc> |
| 229 |
</constant> |
| 230 |
|
| 231 |
<constant name = "syntax-error" value = "502" class = "hard-error"> |
| 232 |
<doc> |
| 233 |
The sender sent a frame that contained illegal values for one or more |
| 234 |
fields. This strongly implies a programming error in the sending peer. |
| 235 |
</doc> |
| 236 |
</constant> |
| 237 |
|
| 238 |
<constant name = "command-invalid" value = "503" class = "hard-error"> |
| 239 |
<doc> |
| 240 |
The client sent an invalid sequence of frames, attempting to perform an |
| 241 |
operation that was considered invalid by the server. This usually implies |
| 242 |
a programming error in the client. |
| 243 |
</doc> |
| 244 |
</constant> |
| 245 |
|
| 246 |
<constant name = "channel-error" value = "504" class = "hard-error"> |
| 247 |
<doc> |
| 248 |
The client attempted to work with a channel that had not been correctly |
| 249 |
opened. This most likely indicates a fault in the client layer. |
| 250 |
</doc> |
| 251 |
</constant> |
| 252 |
|
| 253 |
<constant name = "unexpected-frame" value = "505" class = "hard-error"> |
| 254 |
<doc> |
| 255 |
The peer sent a frame that was not expected, usually in the context of |
| 256 |
a content header and body. This strongly indicates a fault in the peer's |
| 257 |
content processing. |
| 258 |
</doc> |
| 259 |
</constant> |
| 260 |
|
| 261 |
<constant name = "resource-error" value = "506" class = "hard-error"> |
| 262 |
<doc> |
| 263 |
The server could not complete the method because it lacked sufficient |
| 264 |
resources. This may be due to the client creating too many of some type |
| 265 |
of entity. |
| 266 |
</doc> |
| 267 |
</constant> |
| 268 |
|
| 269 |
<constant name = "not-allowed" value = "530" class = "hard-error"> |
| 270 |
<doc> |
| 271 |
The client tried to work with some entity in a manner that is prohibited |
| 272 |
by the server, due to security settings or by some other criteria. |
| 273 |
</doc> |
| 274 |
</constant> |
| 275 |
|
| 276 |
<constant name = "not-implemented" value = "540" class = "hard-error"> |
| 277 |
<doc> |
| 278 |
The client tried to use functionality that is not implemented in the |
| 279 |
server. |
| 280 |
</doc> |
| 281 |
</constant> |
| 282 |
|
| 283 |
<constant name = "internal-error" value = "541" class = "hard-error"> |
| 284 |
<doc> |
| 285 |
The server could not complete the method because of an internal error. |
| 286 |
The server may require intervention by an operator in order to resume |
| 287 |
normal operations. |
| 288 |
</doc> |
| 289 |
</constant> |
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
<domain name = "class-id" type = "short" /> |
| 298 |
|
| 299 |
<domain name = "consumer-tag" type = "shortstr" label = "consumer tag"> |
| 300 |
<doc> |
| 301 |
Identifier for the consumer, valid within the current channel. |
| 302 |
</doc> |
| 303 |
</domain> |
| 304 |
|
| 305 |
<domain name = "delivery-tag" type = "longlong" label = "server-assigned delivery tag"> |
| 306 |
<doc> |
| 307 |
The server-assigned and channel-specific delivery tag |
| 308 |
</doc> |
| 309 |
<rule name = "channel-local"> |
| 310 |
<doc> |
| 311 |
The delivery tag is valid only within the channel from which the message was |
| 312 |
received. I.e. a client MUST NOT receive a message on one channel and then |
| 313 |
acknowledge it on another. |
| 314 |
</doc> |
| 315 |
</rule> |
| 316 |
<rule name = "non-zero"> |
| 317 |
<doc> |
| 318 |
The server MUST NOT use a zero value for delivery tags. Zero is reserved |
| 319 |
for client use, meaning "all messages so far received". |
| 320 |
</doc> |
| 321 |
</rule> |
| 322 |
</domain> |
| 323 |
|
| 324 |
<domain name = "exchange-name" type = "shortstr" label = "exchange name"> |
| 325 |
<doc> |
| 326 |
The exchange name is a client-selected string that identifies the exchange for |
| 327 |
publish methods. |
| 328 |
</doc> |
| 329 |
<assert check = "length" value = "127" /> |
| 330 |
<assert check = "regexp" value = "^[a-zA-Z0-9-_.:]*$" /> |
| 331 |
</domain> |
| 332 |
|
| 333 |
<domain name = "method-id" type = "short" /> |
| 334 |
|
| 335 |
<domain name = "no-ack" type = "bit" label = "no acknowledgement needed"> |
| 336 |
<doc> |
| 337 |
If this field is set the server does not expect acknowledgements for |
| 338 |
messages. That is, when a message is delivered to the client the server |
| 339 |
assumes the delivery will succeed and immediately dequeues it. This |
| 340 |
functionality may increase performance but at the cost of reliability. |
| 341 |
Messages can get lost if a client dies before they are delivered to the |
| 342 |
application. |
| 343 |
</doc> |
| 344 |
</domain> |
| 345 |
|
| 346 |
<domain name = "no-local" type = "bit" label = "do not deliver own messages"> |
| 347 |
<doc> |
| 348 |
If the no-local field is set the server will not send messages to the connection that |
| 349 |
published them. |
| 350 |
</doc> |
| 351 |
</domain> |
| 352 |
|
| 353 |
<domain name = "no-wait" type = "bit" label = "do not send reply method"> |
| 354 |
<doc> |
| 355 |
If set, the server will not respond to the method. The client should not wait |
| 356 |
for a reply method. If the server could not complete the method it will raise a |
| 357 |
channel or connection exception. |
| 358 |
</doc> |
| 359 |
</domain> |
| 360 |
|
| 361 |
<domain name = "path" type = "shortstr"> |
| 362 |
<doc> |
| 363 |
Unconstrained. |
| 364 |
</doc> |
| 365 |
<assert check = "notnull" /> |
| 366 |
<assert check = "length" value = "127" /> |
| 367 |
</domain> |
| 368 |
|
| 369 |
<domain name = "peer-properties" type = "table"> |
| 370 |
<doc> |
| 371 |
This table provides a set of peer properties, used for identification, debugging, |
| 372 |
and general information. |
| 373 |
</doc> |
| 374 |
</domain> |
| 375 |
|
| 376 |
<domain name = "queue-name" type = "shortstr" label = "queue name"> |
| 377 |
<doc> |
| 378 |
The queue name identifies the queue within the vhost. In methods where the queue |
| 379 |
name may be blank, and that has no specific significance, this refers to the |
| 380 |
'current' queue for the channel, meaning the last queue that the client declared |
| 381 |
on the channel. If the client did not declare a queue, and the method needs a |
| 382 |
queue name, this will result in a 502 (syntax error) channel exception. |
| 383 |
</doc> |
| 384 |
<assert check = "length" value = "127" /> |
| 385 |
<assert check = "regexp" value = "^[a-zA-Z0-9-_.:]*$" /> |
| 386 |
</domain> |
| 387 |
|
| 388 |
<domain name = "redelivered" type = "bit" label = "message is being redelivered"> |
| 389 |
<doc> |
| 390 |
This indicates that the message has been previously delivered to this or |
| 391 |
another client. |
| 392 |
</doc> |
| 393 |
<rule name = "implementation"> |
| 394 |
<doc> |
| 395 |
The server SHOULD try to signal redelivered messages when it can. When |
| 396 |
redelivering a message that was not successfully acknowledged, the server |
| 397 |
SHOULD deliver it to the original client if possible. |
| 398 |
</doc> |
| 399 |
<doc type = "scenario"> |
| 400 |
Declare a shared queue and publish a message to the queue. Consume the |
| 401 |
message using explicit acknowledgements, but do not acknowledge the |
| 402 |
message. Close the connection, reconnect, and consume from the queue |
| 403 |
again. The message should arrive with the redelivered flag set. |
| 404 |
</doc> |
| 405 |
</rule> |
| 406 |
<rule name = "hinting"> |
| 407 |
<doc> |
| 408 |
The client MUST NOT rely on the redelivered field but should take it as a |
| 409 |
hint that the message may already have been processed. A fully robust |
| 410 |
client must be able to track duplicate received messages on non-transacted, |
| 411 |
and locally-transacted channels. |
| 412 |
</doc> |
| 413 |
</rule> |
| 414 |
</domain> |
| 415 |
|
| 416 |
<domain name = "message-count" type = "long" label = "number of messages in queue"> |
| 417 |
<doc> |
| 418 |
The number of messages in the queue, which will be zero for newly-declared |
| 419 |
queues. This is the number of messages present in the queue, and committed |
| 420 |
if the channel on which they were published is transacted, that are not |
| 421 |
waiting acknowledgement. |
| 422 |
</doc> |
| 423 |
</domain> |
| 424 |
|
| 425 |
<domain name = "reply-code" type = "short" label = "reply code from server"> |
| 426 |
<doc> |
| 427 |
The reply code. The AMQ reply codes are defined as constants at the start |
| 428 |
of this formal specification. |
| 429 |
</doc> |
| 430 |
<assert check = "notnull" /> |
| 431 |
</domain> |
| 432 |
|
| 433 |
<domain name = "reply-text" type = "shortstr" label = "localised reply text"> |
| 434 |
<doc> |
| 435 |
The localised reply text. This text can be logged as an aid to resolving |
| 436 |
issues. |
| 437 |
</doc> |
| 438 |
<assert check = "notnull" /> |
| 439 |
</domain> |
| 440 |
|
| 441 |
|
| 442 |
<domain name = "bit" type = "bit" label = "single bit" /> |
| 443 |
<domain name = "octet" type = "octet" label = "single octet" /> |
| 444 |
<domain name = "short" type = "short" label = "16-bit integer" /> |
| 445 |
<domain name = "long" type = "long" label = "32-bit integer" /> |
| 446 |
<domain name = "longlong" type = "longlong" label = "64-bit integer" /> |
| 447 |
<domain name = "shortstr" type = "shortstr" label = "short string" /> |
| 448 |
<domain name = "longstr" type = "longstr" label = "long string" /> |
| 449 |
<domain name = "timestamp" type = "timestamp" label = "64-bit timestamp" /> |
| 450 |
<domain name = "table" type = "table" label = "field table" /> |
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
<class name = "connection" handler = "connection" index = "10" label = "work with socket connections"> |
| 455 |
<doc> |
| 456 |
The connection class provides methods for a client to establish a network connection to |
| 457 |
a server, and for both peers to operate the connection thereafter. |
| 458 |
</doc> |
| 459 |
|
| 460 |
<doc type = "grammar"> |
| 461 |
connection = open-connection *use-connection close-connection |
| 462 |
open-connection = C:protocol-header |
| 463 |
S:START C:START-OK |
| 464 |
*challenge |
| 465 |
S:TUNE C:TUNE-OK |
| 466 |
C:OPEN S:OPEN-OK |
| 467 |
challenge = S:SECURE C:SECURE-OK |
| 468 |
use-connection = *channel |
| 469 |
close-connection = C:CLOSE S:CLOSE-OK |
| 470 |
/ S:CLOSE C:CLOSE-OK |
| 471 |
</doc> |
| 472 |
|
| 473 |
<chassis name = "server" implement = "MUST" /> |
| 474 |
<chassis name = "client" implement = "MUST" /> |
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
<method name = "start" synchronous = "1" index = "10" label = "start connection negotiation"> |
| 479 |
<doc> |
| 480 |
This method starts the connection negotiation process by telling the client the |
| 481 |
protocol version that the server proposes, along with a list of security mechanisms |
| 482 |
which the client can use for authentication. |
| 483 |
</doc> |
| 484 |
|
| 485 |
<rule name = "protocol-name"> |
| 486 |
<doc> |
| 487 |
If the server cannot support the protocol specified in the protocol header, |
| 488 |
it MUST respond with a valid protocol header and then close the socket |
| 489 |
connection. |
| 490 |
</doc> |
| 491 |
<doc type = "scenario"> |
| 492 |
The client sends a protocol header containing an invalid protocol name. |
| 493 |
The server MUST respond by sending a valid protocol header and then closing |
| 494 |
the connection. |
| 495 |
</doc> |
| 496 |
</rule> |
| 497 |
<rule name = "server-support"> |
| 498 |
<doc> |
| 499 |
The server MUST provide a protocol version that is lower than or equal to |
| 500 |
that requested by the client in the protocol header. |
| 501 |
</doc> |
| 502 |
<doc type = "scenario"> |
| 503 |
The client requests a protocol version that is higher than any valid |
| 504 |
implementation, e.g. 2.0. The server must respond with a protocol header |
| 505 |
indicating its supported protocol version, e.g. 1.0. |
| 506 |
</doc> |
| 507 |
</rule> |
| 508 |
<rule name = "client-support"> |
| 509 |
<doc> |
| 510 |
If the client cannot handle the protocol version suggested by the server |
| 511 |
it MUST close the socket connection without sending any further data. |
| 512 |
</doc> |
| 513 |
<doc type = "scenario"> |
| 514 |
The server sends a protocol version that is lower than any valid |
| 515 |
implementation, e.g. 0.1. The client must respond by closing the |
| 516 |
connection without sending any further data. |
| 517 |
</doc> |
| 518 |
</rule> |
| 519 |
|
| 520 |
<chassis name = "client" implement = "MUST" /> |
| 521 |
<response name = "start-ok" /> |
| 522 |
|
| 523 |
<field name = "version-major" domain = "octet" label = "protocol major version"> |
| 524 |
<doc> |
| 525 |
The major version number can take any value from 0 to 99 as defined in the |
| 526 |
AMQP specification. |
| 527 |
</doc> |
| 528 |
</field> |
| 529 |
|
| 530 |
<field name = "version-minor" domain = "octet" label = "protocol minor version"> |
| 531 |
<doc> |
| 532 |
The minor version number can take any value from 0 to 99 as defined in the |
| 533 |
AMQP specification. |
| 534 |
</doc> |
| 535 |
</field> |
| 536 |
|
| 537 |
<field name = "server-properties" domain = "peer-properties" label = "server properties"> |
| 538 |
<rule name = "required-fields"> |
| 539 |
<doc> |
| 540 |
The properties SHOULD contain at least these fields: "host", specifying the |
| 541 |
server host name or address, "product", giving the name of the server product, |
| 542 |
"version", giving the name of the server version, "platform", giving the name |
| 543 |
of the operating system, "copyright", if appropriate, and "information", giving |
| 544 |
other general information. |
| 545 |
</doc> |
| 546 |
<doc type = "scenario"> |
| 547 |
Client connects to server and inspects the server properties. It checks for |
| 548 |
the presence of the required fields. |
| 549 |
</doc> |
| 550 |
</rule> |
| 551 |
</field> |
| 552 |
|
| 553 |
<field name = "mechanisms" domain = "longstr" label = "available security mechanisms"> |
| 554 |
<doc> |
| 555 |
A list of the security mechanisms that the server supports, delimited by spaces. |
| 556 |
</doc> |
| 557 |
<assert check = "notnull" /> |
| 558 |
</field> |
| 559 |
|
| 560 |
<field name = "locales" domain = "longstr" label = "available message locales"> |
| 561 |
<doc> |
| 562 |
A list of the message locales that the server supports, delimited by spaces. The |
| 563 |
locale defines the language in which the server will send reply texts. |
| 564 |
</doc> |
| 565 |
<rule name = "required-support"> |
| 566 |
<doc> |
| 567 |
The server MUST support at least the en_US locale. |
| 568 |
</doc> |
| 569 |
<doc type = "scenario"> |
| 570 |
Client connects to server and inspects the locales field. It checks for |
| 571 |
the presence of the required locale(s). |
| 572 |
</doc> |
| 573 |
</rule> |
| 574 |
<assert check = "notnull" /> |
| 575 |
</field> |
| 576 |
</method> |
| 577 |
|
| 578 |
<method name = "start-ok" synchronous = "1" index = "11" |
| 579 |
label = "select security mechanism and locale"> |
| 580 |
<doc> |
| 581 |
This method selects a SASL security mechanism. |
| 582 |
</doc> |
| 583 |
|
| 584 |
<chassis name = "server" implement = "MUST" /> |
| 585 |
|
| 586 |
<field name = "client-properties" domain = "peer-properties" label = "client properties"> |
| 587 |
<rule name = "required-fields"> |
| 588 |
|
| 589 |
<doc> |
| 590 |
The properties SHOULD contain at least these fields: "product", giving the name |
| 591 |
of the client product, "version", giving the name of the client version, "platform", |
| 592 |
giving the name of the operating system, "copyright", if appropriate, and |
| 593 |
"information", giving other general information. |
| 594 |
</doc> |
| 595 |
</rule> |
| 596 |
</field> |
| 597 |
|
| 598 |
<field name = "mechanism" domain = "shortstr" label = "selected security mechanism"> |
| 599 |
<doc> |
| 600 |
A single security mechanisms selected by the client, which must be one of those |
| 601 |
specified by the server. |
| 602 |
</doc> |
| 603 |
<rule name = "security"> |
| 604 |
<doc> |
| 605 |
The client SHOULD authenticate using the highest-level security profile it |
| 606 |
can handle from the list provided by the server. |
| 607 |
</doc> |
| 608 |
</rule> |
| 609 |
<rule name = "validity"> |
| 610 |
<doc> |
| 611 |
If the mechanism field does not contain one of the security mechanisms |
| 612 |
proposed by the server in the Start method, the server MUST close the |
| 613 |
connection without sending any further data. |
| 614 |
</doc> |
| 615 |
<doc type = "scenario"> |
| 616 |
Client connects to server and sends an invalid security mechanism. The |
| 617 |
server must respond by closing the connection (a socket close, with no |
| 618 |
connection close negotiation). |
| 619 |
</doc> |
| 620 |
</rule> |
| 621 |
<assert check = "notnull" /> |
| 622 |
</field> |
| 623 |
|
| 624 |
<field name = "response" domain = "longstr" label = "security response data"> |
| 625 |
<doc> |
| 626 |
A block of opaque data passed to the security mechanism. The contents of this |
| 627 |
data are defined by the SASL security mechanism. |
| 628 |
</doc> |
| 629 |
<assert check = "notnull" /> |
| 630 |
</field> |
| 631 |
|
| 632 |
<field name = "locale" domain = "shortstr" label = "selected message locale"> |
| 633 |
<doc> |
| 634 |
A single message locale selected by the client, which must be one of those |
| 635 |
specified by the server. |
| 636 |
</doc> |
| 637 |
<assert check = "notnull" /> |
| 638 |
</field> |
| 639 |
</method> |
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
<method name = "secure" synchronous = "1" index = "20" label = "security mechanism challenge"> |
| 644 |
<doc> |
| 645 |
The SASL protocol works by exchanging challenges and responses until both peers have |
| 646 |
received sufficient information to authenticate each other. This method challenges |
| 647 |
the client to provide more information. |
| 648 |
</doc> |
| 649 |
|
| 650 |
<chassis name = "client" implement = "MUST" /> |
| 651 |
<response name = "secure-ok" /> |
| 652 |
|
| 653 |
<field name = "challenge" domain = "longstr" label = "security challenge data"> |
| 654 |
<doc> |
| 655 |
Challenge information, a block of opaque binary data passed to the security |
| 656 |
mechanism. |
| 657 |
</doc> |
| 658 |
</field> |
| 659 |
</method> |
| 660 |
|
| 661 |
<method name = "secure-ok" synchronous = "1" index = "21" label = "security mechanism response"> |
| 662 |
<doc> |
| 663 |
This method attempts to authenticate, passing a block of SASL data for the security |
| 664 |
mechanism at the server side. |
| 665 |
</doc> |
| 666 |
|
| 667 |
<chassis name = "server" implement = "MUST" /> |
| 668 |
|
| 669 |
<field name = "response" domain = "longstr" label = "security response data"> |
| 670 |
<doc> |
| 671 |
A block of opaque data passed to the security mechanism. The contents of this |
| 672 |
data are defined by the SASL security mechanism. |
| 673 |
</doc> |
| 674 |
<assert check = "notnull" /> |
| 675 |
</field> |
| 676 |
</method> |
| 677 |
|
| 678 |
|
| 679 |
|
| 680 |
<method name = "tune" synchronous = "1" index = "30" |
| 681 |
label = "propose connection tuning parameters"> |
| 682 |
<doc> |
| 683 |
This method proposes a set of connection configuration values to the client. The |
| 684 |
client can accept and/or adjust these. |
| 685 |
</doc> |
| 686 |
|
| 687 |
<chassis name = "client" implement = "MUST" /> |
| 688 |
|
| 689 |
<response name = "tune-ok" /> |
| 690 |
|
| 691 |
<field name = "channel-max" domain = "short" label = "proposed maximum channels"> |
| 692 |
<doc> |
| 693 |
Specifies highest channel number that the server permits. Usable channel numbers |
| 694 |
are in the range 1..channel-max. Zero indicates no specified limit. |
| 695 |
</doc> |
| 696 |
</field> |
| 697 |
|
| 698 |
<field name = "frame-max" domain = "long" label = "proposed maximum frame size"> |
| 699 |
<doc> |
| 700 |
The largest frame size that the server proposes for the connection, including |
| 701 |
frame header and end-byte. The client can negotiate a lower value. Zero means |
| 702 |
that the server does not impose any specific limit but may reject very large |
| 703 |
frames if it cannot allocate resources for them. |
| 704 |
</doc> |
| 705 |
<rule name = "minimum"> |
| 706 |
<doc> |
| 707 |
Until the frame-max has been negotiated, both peers MUST accept frames of up |
| 708 |
to frame-min-size octets large, and the minimum negotiated value for frame-max |
| 709 |
is also frame-min-size. |
| 710 |
</doc> |
| 711 |
<doc type = "scenario"> |
| 712 |
Client connects to server and sends a large properties field, creating a frame |
| 713 |
of frame-min-size octets. The server must accept this frame. |
| 714 |
</doc> |
| 715 |
</rule> |
| 716 |
</field> |
| 717 |
|
| 718 |
<field name = "heartbeat" domain = "short" label = "desired heartbeat delay"> |
| 719 |
<doc> |
| 720 |
The delay, in seconds, of the connection heartbeat that the server wants. |
| 721 |
Zero means the server does not want a heartbeat. |
| 722 |
</doc> |
| 723 |
</field> |
| 724 |
</method> |
| 725 |
|
| 726 |
<method name = "tune-ok" synchronous = "1" index = "31" |
| 727 |
label = "negotiate connection tuning parameters"> |
| 728 |
<doc> |
| 729 |
This method sends the client's connection tuning parameters to the server. |
| 730 |
Certain fields are negotiated, others provide capability information. |
| 731 |
</doc> |
| 732 |
|
| 733 |
<chassis name = "server" implement = "MUST" /> |
| 734 |
|
| 735 |
<field name = "channel-max" domain = "short" label = "negotiated maximum channels"> |
| 736 |
<doc> |
| 737 |
The maximum total number of channels that the client will use per connection. |
| 738 |
</doc> |
| 739 |
<rule name = "upper-limit"> |
| 740 |
<doc> |
| 741 |
If the client specifies a channel max that is higher than the value provided |
| 742 |
by the server, the server MUST close the connection without attempting a |
| 743 |
negotiated close. The server may report the error in some fashion to assist |
| 744 |
implementors. |
| 745 |
</doc> |
| 746 |
</rule> |
| 747 |
<assert check = "notnull" /> |
| 748 |
<assert check = "le" method = "tune" field = "channel-max" /> |
| 749 |
</field> |
| 750 |
|
| 751 |
<field name = "frame-max" domain = "long" label = "negotiated maximum frame size"> |
| 752 |
<doc> |
| 753 |
The largest frame size that the client and server will use for the connection. |
| 754 |
Zero means that the client does not impose any specific limit but may reject |
| 755 |
very large frames if it cannot allocate resources for them. Note that the |
| 756 |
frame-max limit applies principally to content frames, where large contents can |
| 757 |
be broken into frames of arbitrary size. |
| 758 |
</doc> |
| 759 |
<rule name = "minimum"> |
| 760 |
<doc> |
| 761 |
Until the frame-max has been negotiated, both peers MUST accept frames of up |
| 762 |
to frame-min-size octets large, and the minimum negotiated value for frame-max |
| 763 |
is also frame-min-size. |
| 764 |
</doc> |
| 765 |
</rule> |
| 766 |
<rule name = "upper-limit"> |
| 767 |
<doc> |
| 768 |
If the client specifies a frame max that is higher than the value provided |
| 769 |
by the server, the server MUST close the connection without attempting a |
| 770 |
negotiated close. The server may report the error in some fashion to assist |
| 771 |
implementors. |
| 772 |
</doc> |
| 773 |
</rule> |
| 774 |
</field> |
| 775 |
|
| 776 |
<field name = "heartbeat" domain = "short" label = "desired heartbeat delay"> |
| 777 |
<doc> |
| 778 |
The delay, in seconds, of the connection heartbeat that the client wants. Zero |
| 779 |
means the client does not want a heartbeat. |
| 780 |
</doc> |
| 781 |
</field> |
| 782 |
</method> |
| 783 |
|
| 784 |
|
| 785 |
|
| 786 |
<method name = "open" synchronous = "1" index = "40" label = "open connection to virtual host"> |
| 787 |
<doc> |
| 788 |
This method opens a connection to a virtual host, which is a collection of |
| 789 |
resources, and acts to separate multiple application domains within a server. |
| 790 |
The server may apply arbitrary limits per virtual host, such as the number |
| 791 |
of each type of entity that may be used, per connection and/or in total. |
| 792 |
</doc> |
| 793 |
|
| 794 |
<chassis name = "server" implement = "MUST" /> |
| 795 |
<response name = "open-ok" /> |
| 796 |
|
| 797 |
<field name = "virtual-host" domain = "path" label = "virtual host name"> |
| 798 |
<doc> |
| 799 |
The name of the virtual host to work with. |
| 800 |
</doc> |
| 801 |
<rule name = "separation"> |
| 802 |
<doc> |
| 803 |
If the server supports multiple virtual hosts, it MUST enforce a full |
| 804 |
separation of exchanges, queues, and all associated entities per virtual |
| 805 |
host. An application, connected to a specific virtual host, MUST NOT be able |
| 806 |
to access resources of another virtual host. |
| 807 |
</doc> |
| 808 |
</rule> |
| 809 |
<rule name = "security"> |
| 810 |
<doc> |
| 811 |
The server SHOULD verify that the client has permission to access the |
| 812 |
specified virtual host. |
| 813 |
</doc> |
| 814 |
</rule> |
| 815 |
</field> |
| 816 |
|
| 817 |
<field name = "reserved-1" type = "shortstr" reserved = "1" /> |
| 818 |
|
| 819 |
<field name = "reserved-2" type = "bit" reserved = "1" /> |
| 820 |
</method> |
| 821 |
|
| 822 |
<method name = "open-ok" synchronous = "1" index = "41" label = "signal that connection is ready"> |
| 823 |
<doc> |
| 824 |
This method signals to the client that the connection is ready for use. |
| 825 |
</doc> |
| 826 |
<chassis name = "client" implement = "MUST" /> |
| 827 |
|
| 828 |
<field name = "reserved-1" type = "shortstr" reserved = "1" /> |
| 829 |
</method> |
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
<method name = "close" synchronous = "1" index = "50" label = "request a connection close"> |
| 834 |
<doc> |
| 835 |
This method indicates that the sender wants to close the connection. This may be |
| 836 |
due to internal conditions (e.g. a forced shut-down) or due to an error handling |
| 837 |
a specific method, i.e. an exception. When a close is due to an exception, the |
| 838 |
sender provides the class and method id of the method which caused the exception. |
| 839 |
</doc> |
| 840 |
<rule name = "stability"> |
| 841 |
<doc> |
| 842 |
After sending this method, any received methods except Close and Close-OK MUST |
| 843 |
be discarded. The response to receiving a Close after sending Close must be to |
| 844 |
send Close-Ok. |
| 845 |
</doc> |
| 846 |
</rule> |
| 847 |
|
| 848 |
<chassis name = "client" implement = "MUST" /> |
| 849 |
<chassis name = "server" implement = "MUST" /> |
| 850 |
<response name = "close-ok" /> |
| 851 |
|
| 852 |
<field name = "reply-code" domain = "reply-code" /> |
| 853 |
<field name = "reply-text" domain = "reply-text" /> |
| 854 |
|
| 855 |
<field name = "class-id" domain = "class-id" label = "failing method class"> |
| 856 |
<doc> |
| 857 |
When the close is provoked by a method exception, this is the class of the |
| 858 |
method. |
| 859 |
</doc> |
| 860 |
</field> |
| 861 |
|
| 862 |
<field name = "method-id" domain = "method-id" label = "failing method ID"> |
| 863 |
<doc> |
| 864 |
When the close is provoked by a method exception, this is the ID of the method. |
| 865 |
</doc> |
| 866 |
</field> |
| 867 |
</method> |
| 868 |
|
| 869 |
<method name = "close-ok" synchronous = "1" index = "51" label = "confirm a connection close"> |
| 870 |
<doc> |
| 871 |
This method confirms a Connection.Close method and tells the recipient that it is |
| 872 |
safe to release resources for the connection and close the socket. |
| 873 |
</doc> |
| 874 |
<rule name = "reporting"> |
| 875 |
<doc> |
| 876 |
A peer that detects a socket closure without having received a Close-Ok |
| 877 |
handshake method SHOULD log the error. |
| 878 |
</doc> |
| 879 |
</rule> |
| 880 |
<chassis name = "client" implement = "MUST" /> |
| 881 |
<chassis name = "server" implement = "MUST" /> |
| 882 |
</method> |
| 883 |
</class> |
| 884 |
|
| 885 |
|
| 886 |
|
| 887 |
<class name = "channel" handler = "channel" index = "20" label = "work with channels"> |
| 888 |
<doc> |
| 889 |
The channel class provides methods for a client to establish a channel to a |
| 890 |
server and for both peers to operate the channel thereafter. |
| 891 |
</doc> |
| 892 |
|
| 893 |
<doc type = "grammar"> |
| 894 |
channel = open-channel *use-channel close-channel |
| 895 |
open-channel = C:OPEN S:OPEN-OK |
| 896 |
use-channel = C:FLOW S:FLOW-OK |
| 897 |
/ S:FLOW C:FLOW-OK |
| 898 |
/ functional-class |
| 899 |
close-channel = C:CLOSE S:CLOSE-OK |
| 900 |
/ S:CLOSE C:CLOSE-OK |
| 901 |
</doc> |
| 902 |
|
| 903 |
<chassis name = "server" implement = "MUST" /> |
| 904 |
<chassis name = "client" implement = "MUST" /> |
| 905 |
|
| 906 |
|
| 907 |
|
| 908 |
<method name = "open" synchronous = "1" index = "10" label = "open a channel for use"> |
| 909 |
<doc> |
| 910 |
This method opens a channel to the server. |
| 911 |
</doc> |
| 912 |
<rule name = "state" on-failure = "channel-error"> |
| 913 |
<doc> |
| 914 |
The client MUST NOT use this method on an already-opened channel. |
| 915 |
</doc> |
| 916 |
<doc type = "scenario"> |
| 917 |
Client opens a channel and then reopens the same channel. |
| 918 |
</doc> |
| 919 |
</rule> |
| 920 |
<chassis name = "server" implement = "MUST" /> |
| 921 |
<response name = "open-ok" /> |
| 922 |
|
| 923 |
<field name = "reserved-1" type = "shortstr" reserved = "1" /> |
| 924 |
</method> |
| 925 |
|
| 926 |
<method name = "open-ok" synchronous = "1" index = "11" label = "signal that the channel is ready"> |
| 927 |
<doc> |
| 928 |
This method signals to the client that the channel is ready for use. |
| 929 |
</doc> |
| 930 |
<chassis name = "client" implement = "MUST" /> |
| 931 |
|
| 932 |
<field name = "reserved-1" type = "longstr" reserved = "1" /> |
| 933 |
</method> |
| 934 |
|
| 935 |
|
| 936 |
|
| 937 |
<method name = "flow" synchronous = "1" index = "20" label = "enable/disable flow from peer"> |
| 938 |
<doc> |
| 939 |
This method asks the peer to pause or restart the flow of content data sent by |
| 940 |
a consumer. This is a simple flow-control mechanism that a peer can use to avoid |
| 941 |
overflowing its queues or otherwise finding itself receiving more messages than |
| 942 |
it can process. Note that this method is not intended for window control. It does |
| 943 |
not affect contents returned by Basic.Get-Ok methods. |
| 944 |
</doc> |
| 945 |
|
| 946 |
<rule name = "initial-state"> |
| 947 |
<doc> |
| 948 |
When a new channel is opened, it is active (flow is active). Some applications |
| 949 |
assume that channels are inactive until started. To emulate this behaviour a |
| 950 |
client MAY open the channel, then pause it. |
| 951 |
</doc> |
| 952 |
</rule> |
| 953 |
|
| 954 |
<rule name = "bidirectional"> |
| 955 |
<doc> |
| 956 |
When sending content frames, a peer SHOULD monitor the channel for incoming |
| 957 |
methods and respond to a Channel.Flow as rapidly as possible. |
| 958 |
</doc> |
| 959 |
</rule> |
| 960 |
|
| 961 |
<rule name = "throttling"> |
| 962 |
<doc> |
| 963 |
A peer MAY use the Channel.Flow method to throttle incoming content data for |
| 964 |
internal reasons, for example, when exchanging data over a slower connection. |
| 965 |
</doc> |
| 966 |
</rule> |
| 967 |
|
| 968 |
<rule name = "expected-behaviour"> |
| 969 |
<doc> |
| 970 |
The peer that requests a Channel.Flow method MAY disconnect and/or ban a peer |
| 971 |
that does not respect the request. This is to prevent badly-behaved clients |
| 972 |
from overwhelming a server. |
| 973 |
</doc> |
| 974 |
</rule> |
| 975 |
|
| 976 |
<chassis name = "server" implement = "MUST" /> |
| 977 |
<chassis name = "client" implement = "MUST" /> |
| 978 |
|
| 979 |
<response name = "flow-ok" /> |
| 980 |
|
| 981 |
<field name = "active" domain = "bit" label = "start/stop content frames"> |
| 982 |
<doc> |
| 983 |
If 1, the peer starts sending content frames. If 0, the peer stops sending |
| 984 |
content frames. |
| 985 |
</doc> |
| 986 |
</field> |
| 987 |
</method> |
| 988 |
|
| 989 |
<method name = "flow-ok" index = "21" label = "confirm a flow method"> |
| 990 |
<doc> |
| 991 |
Confirms to the peer that a flow command was received and processed. |
| 992 |
</doc> |
| 993 |
<chassis name = "server" implement = "MUST" /> |
| 994 |
<chassis name = "client" implement = "MUST" /> |
| 995 |
<field name = "active" domain = "bit" label = "current flow setting"> |
| 996 |
<doc> |
| 997 |
Confirms the setting of the processed flow method: 1 means the peer will start |
| 998 |
sending or continue to send content frames; 0 means it will not. |
| 999 |
</doc> |
| 1000 |
</field> |
| 1001 |
</method> |
| 1002 |
|
| 1003 |
|
| 1004 |
|
| 1005 |
<method name = "close" synchronous = "1" index = "40" label = "request a channel close"> |
| 1006 |
<doc> |
| 1007 |
This method indicates that the sender wants to close the channel. This may be due to |
| 1008 |
internal conditions (e.g. a forced shut-down) or due to an error handling a specific |
| 1009 |
method, i.e. an exception. When a close is due to an exception, the sender provides |
| 1010 |
the class and method id of the method which caused the exception. |
| 1011 |
</doc> |
| 1012 |
<rule name = "stability"> |
| 1013 |
<doc> |
| 1014 |
After sending this method, any received methods except Close and Close-OK MUST |
| 1015 |
be discarded. The response to receiving a Close after sending Close must be to |
| 1016 |
send Close-Ok. |
| 1017 |
</doc> |
| 1018 |
</rule> |
| 1019 |
|
| 1020 |
<chassis name = "client" implement = "MUST" /> |
| 1021 |
<chassis name = "server" implement = "MUST" /> |
| 1022 |
<response name = "close-ok" /> |
| 1023 |
|
| 1024 |
<field name = "reply-code" domain = "reply-code" /> |
| 1025 |
<field name = "reply-text" domain = "reply-text" /> |
| 1026 |
|
| 1027 |
<field name = "class-id" domain = "class-id" label = "failing method class"> |
| 1028 |
<doc> |
| 1029 |
When the close is provoked by a method exception, this is the class of the |
| 1030 |
method. |
| 1031 |
</doc> |
| 1032 |
</field> |
| 1033 |
|
| 1034 |
<field name = "method-id" domain = "method-id" label = "failing method ID"> |
| 1035 |
<doc> |
| 1036 |
When the close is provoked by a method exception, this is the ID of the method. |
| 1037 |
</doc> |
| 1038 |
</field> |
| 1039 |
</method> |
| 1040 |
|
| 1041 |
<method name = "close-ok" synchronous = "1" index = "41" label = "confirm a channel close"> |
| 1042 |
<doc> |
| 1043 |
This method confirms a Channel.Close method and tells the recipient that it is safe |
| 1044 |
to release resources for the channel. |
| 1045 |
</doc> |
| 1046 |
<rule name = "reporting"> |
| 1047 |
<doc> |
| 1048 |
A peer that detects a socket closure without having received a Channel.Close-Ok |
| 1049 |
handshake method SHOULD log the error. |
| 1050 |
</doc> |
| 1051 |
</rule> |
| 1052 |
<chassis name = "client" implement = "MUST" /> |
| 1053 |
<chassis name = "server" implement = "MUST" /> |
| 1054 |
</method> |
| 1055 |
</class> |
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
<class name = "exchange" handler = "channel" index = "40" label = "work with exchanges"> |
| 1060 |
<doc> |
| 1061 |
Exchanges match and distribute messages across queues. Exchanges can be configured in |
| 1062 |
the server or declared at runtime. |
| 1063 |
</doc> |
| 1064 |
|
| 1065 |
<doc type = "grammar"> |
| 1066 |
exchange = C:DECLARE S:DECLARE-OK |
| 1067 |
/ C:DELETE S:DELETE-OK |
| 1068 |
</doc> |
| 1069 |
|
| 1070 |
<chassis name = "server" implement = "MUST" /> |
| 1071 |
<chassis name = "client" implement = "MUST" /> |
| 1072 |
|
| 1073 |
<rule name = "required-types"> |
| 1074 |
<doc> |
| 1075 |
The server MUST implement these standard exchange types: fanout, direct. |
| 1076 |
</doc> |
| 1077 |
<doc type = "scenario"> |
| 1078 |
Client attempts to declare an exchange with each of these standard types. |
| 1079 |
</doc> |
| 1080 |
</rule> |
| 1081 |
<rule name = "recommended-types"> |
| 1082 |
<doc> |
| 1083 |
The server SHOULD implement these standard exchange types: topic, headers. |
| 1084 |
</doc> |
| 1085 |
<doc type = "scenario"> |
| 1086 |
Client attempts to declare an exchange with each of these standard types. |
| 1087 |
</doc> |
| 1088 |
</rule> |
| 1089 |
<rule name = "required-instances"> |
| 1090 |
<doc> |
| 1091 |
The server MUST, in each virtual host, pre-declare an exchange instance |
| 1092 |
for each standard exchange type that it implements, where the name of the |
| 1093 |
exchange instance, if defined, is "amq." followed by the exchange type name. |
| 1094 |
</doc> |
| 1095 |
<doc> |
| 1096 |
The server MUST, in each virtual host, pre-declare at least two direct |
| 1097 |
exchange instances: one named "amq.direct", the other with no public name |
| 1098 |
that serves as a default exchange for Publish methods. |
| 1099 |
</doc> |
| 1100 |
<doc type = "scenario"> |
| 1101 |
Client declares a temporary queue and attempts to bind to each required |
| 1102 |
exchange instance ("amq.fanout", "amq.direct", "amq.topic", and "amq.headers" |
| 1103 |
if those types are defined). |
| 1104 |
</doc> |
| 1105 |
</rule> |
| 1106 |
<rule name = "default-exchange"> |
| 1107 |
<doc> |
| 1108 |
The server MUST pre-declare a direct exchange with no public name to act as |
| 1109 |
the default exchange for content Publish methods and for default queue bindings. |
| 1110 |
</doc> |
| 1111 |
<doc type = "scenario"> |
| 1112 |
Client checks that the default exchange is active by specifying a queue |
| 1113 |
binding with no exchange name, and publishing a message with a suitable |
| 1114 |
routing key but without specifying the exchange name, then ensuring that |
| 1115 |
the message arrives in the queue correctly. |
| 1116 |
</doc> |
| 1117 |
</rule> |
| 1118 |
<rule name = "default-access"> |
| 1119 |
<doc> |
| 1120 |
The server MUST NOT allow clients to access the default exchange except |
| 1121 |
by specifying an empty exchange name in the Queue.Bind and content Publish |
| 1122 |
methods. |
| 1123 |
</doc> |
| 1124 |
</rule> |
| 1125 |
<rule name = "extensions"> |
| 1126 |
<doc> |
| 1127 |
The server MAY implement other exchange types as wanted. |
| 1128 |
</doc> |
| 1129 |
</rule> |
| 1130 |
|
| 1131 |
|
| 1132 |
|
| 1133 |
<method name = "declare" synchronous = "1" index = "10" label = "verify exchange exists, create if needed"> |
| 1134 |
<doc> |
| 1135 |
This method creates an exchange if it does not already exist, and if the exchange |
| 1136 |
exists, verifies that it is of the correct and expected class. |
| 1137 |
</doc> |
| 1138 |
<rule name = "minimum"> |
| 1139 |
<doc> |
| 1140 |
The server SHOULD support a minimum of 16 exchanges per virtual host and |
| 1141 |
ideally, impose no limit except as defined by available resources. |
| 1142 |
</doc> |
| 1143 |
<doc type = "scenario"> |
| 1144 |
The client declares as many exchanges as it can until the server reports |
| 1145 |
an error; the number of exchanges successfully declared must be at least |
| 1146 |
sixteen. |
| 1147 |
</doc> |
| 1148 |
</rule> |
| 1149 |
|
| 1150 |
<chassis name = "server" implement = "MUST" /> |
| 1151 |
<response name = "declare-ok" /> |
| 1152 |
|
| 1153 |
|
| 1154 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1155 |
|
| 1156 |
<field name = "exchange" domain = "exchange-name"> |
| 1157 |
<rule name = "reserved" on-failure = "access-refused"> |
| 1158 |
<doc> |
| 1159 |
Exchange names starting with "amq." are reserved for pre-declared and |
| 1160 |
standardised exchanges. The client MAY declare an exchange starting with |
| 1161 |
"amq." if the passive option is set, or the exchange already exists. |
| 1162 |
</doc> |
| 1163 |
<doc type = "scenario"> |
| 1164 |
The client attempts to declare a non-existing exchange starting with |
| 1165 |
"amq." and with the passive option set to zero. |
| 1166 |
</doc> |
| 1167 |
</rule> |
| 1168 |
<rule name = "syntax" on-failure = "precondition-failed"> |
| 1169 |
<doc> |
| 1170 |
The exchange name consists of a non-empty sequence of these characters: |
| 1171 |
letters, digits, hyphen, underscore, period, or colon. |
| 1172 |
</doc> |
| 1173 |
<doc type = "scenario"> |
| 1174 |
The client attempts to declare an exchange with an illegal name. |
| 1175 |
</doc> |
| 1176 |
</rule> |
| 1177 |
<assert check = "notnull" /> |
| 1178 |
</field> |
| 1179 |
|
| 1180 |
<field name = "type" domain = "shortstr" label = "exchange type"> |
| 1181 |
<doc> |
| 1182 |
Each exchange belongs to one of a set of exchange types implemented by the |
| 1183 |
server. The exchange types define the functionality of the exchange - i.e. how |
| 1184 |
messages are routed through it. It is not valid or meaningful to attempt to |
| 1185 |
change the type of an existing exchange. |
| 1186 |
</doc> |
| 1187 |
<rule name = "typed" on-failure = "not-allowed"> |
| 1188 |
<doc> |
| 1189 |
Exchanges cannot be redeclared with different types. The client MUST not |
| 1190 |
attempt to redeclare an existing exchange with a different type than used |
| 1191 |
in the original Exchange.Declare method. |
| 1192 |
</doc> |
| 1193 |
<doc type = "scenario"> |
| 1194 |
TODO. |
| 1195 |
</doc> |
| 1196 |
</rule> |
| 1197 |
<rule name = "support" on-failure = "command-invalid"> |
| 1198 |
<doc> |
| 1199 |
The client MUST NOT attempt to declare an exchange with a type that the |
| 1200 |
server does not support. |
| 1201 |
</doc> |
| 1202 |
<doc type = "scenario"> |
| 1203 |
TODO. |
| 1204 |
</doc> |
| 1205 |
</rule> |
| 1206 |
</field> |
| 1207 |
|
| 1208 |
<field name = "passive" domain = "bit" label = "do not create exchange"> |
| 1209 |
<doc> |
| 1210 |
If set, the server will reply with Declare-Ok if the exchange already |
| 1211 |
exists with the same name, and raise an error if not. The client can |
| 1212 |
use this to check whether an exchange exists without modifying the |
| 1213 |
server state. When set, all other method fields except name and no-wait |
| 1214 |
are ignored. A declare with both passive and no-wait has no effect. |
| 1215 |
Arguments are compared for semantic equivalence. |
| 1216 |
</doc> |
| 1217 |
<rule name = "not-found"> |
| 1218 |
<doc> |
| 1219 |
If set, and the exchange does not already exist, the server MUST |
| 1220 |
raise a channel exception with reply code 404 (not found). |
| 1221 |
</doc> |
| 1222 |
<doc type = "scenario"> |
| 1223 |
TODO. |
| 1224 |
</doc> |
| 1225 |
</rule> |
| 1226 |
<rule name = "equivalent"> |
| 1227 |
<doc> |
| 1228 |
If not set and the exchange exists, the server MUST check that the |
| 1229 |
existing exchange has the same values for type, durable, and arguments |
| 1230 |
fields. The server MUST respond with Declare-Ok if the requested |
| 1231 |
exchange matches these fields, and MUST raise a channel exception if |
| 1232 |
not. |
| 1233 |
</doc> |
| 1234 |
<doc type = "scenario"> |
| 1235 |
TODO. |
| 1236 |
</doc> |
| 1237 |
</rule> |
| 1238 |
</field> |
| 1239 |
|
| 1240 |
<field name = "durable" domain = "bit" label = "request a durable exchange"> |
| 1241 |
<doc> |
| 1242 |
If set when creating a new exchange, the exchange will be marked as durable. |
| 1243 |
Durable exchanges remain active when a server restarts. Non-durable exchanges |
| 1244 |
(transient exchanges) are purged if/when a server restarts. |
| 1245 |
</doc> |
| 1246 |
<rule name = "support"> |
| 1247 |
<doc> |
| 1248 |
The server MUST support both durable and transient exchanges. |
| 1249 |
</doc> |
| 1250 |
<doc type = "scenario"> |
| 1251 |
TODO. |
| 1252 |
</doc> |
| 1253 |
</rule> |
| 1254 |
</field> |
| 1255 |
|
| 1256 |
|
| 1257 |
<field name = "reserved-2" type = "bit" reserved = "1" /> |
| 1258 |
|
| 1259 |
<field name = "reserved-3" type = "bit" reserved = "1" /> |
| 1260 |
<field name = "no-wait" domain = "no-wait" /> |
| 1261 |
|
| 1262 |
<field name = "arguments" domain = "table" label = "arguments for declaration"> |
| 1263 |
<doc> |
| 1264 |
A set of arguments for the declaration. The syntax and semantics of these |
| 1265 |
arguments depends on the server implementation. |
| 1266 |
</doc> |
| 1267 |
</field> |
| 1268 |
</method> |
| 1269 |
|
| 1270 |
<method name = "declare-ok" synchronous = "1" index = "11" label = "confirm exchange declaration"> |
| 1271 |
<doc> |
| 1272 |
This method confirms a Declare method and confirms the name of the exchange, |
| 1273 |
essential for automatically-named exchanges. |
| 1274 |
</doc> |
| 1275 |
<chassis name = "client" implement = "MUST" /> |
| 1276 |
</method> |
| 1277 |
|
| 1278 |
|
| 1279 |
|
| 1280 |
<method name = "delete" synchronous = "1" index = "20" label = "delete an exchange"> |
| 1281 |
<doc> |
| 1282 |
This method deletes an exchange. When an exchange is deleted all queue bindings on |
| 1283 |
the exchange are cancelled. |
| 1284 |
</doc> |
| 1285 |
|
| 1286 |
<chassis name = "server" implement = "MUST" /> |
| 1287 |
<response name = "delete-ok" /> |
| 1288 |
|
| 1289 |
|
| 1290 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1291 |
|
| 1292 |
<field name = "exchange" domain = "exchange-name"> |
| 1293 |
<rule name = "exists" on-failure = "not-found"> |
| 1294 |
<doc> |
| 1295 |
The client MUST NOT attempt to delete an exchange that does not exist. |
| 1296 |
</doc> |
| 1297 |
</rule> |
| 1298 |
<assert check = "notnull" /> |
| 1299 |
</field> |
| 1300 |
|
| 1301 |
<field name = "if-unused" domain = "bit" label = "delete only if unused"> |
| 1302 |
<doc> |
| 1303 |
If set, the server will only delete the exchange if it has no queue bindings. If |
| 1304 |
the exchange has queue bindings the server does not delete it but raises a |
| 1305 |
channel exception instead. |
| 1306 |
</doc> |
| 1307 |
<rule name = "in-use" on-failure = "precondition-failed"> |
| 1308 |
<doc> |
| 1309 |
The server MUST NOT delete an exchange that has bindings on it, if the if-unused |
| 1310 |
field is true. |
| 1311 |
</doc> |
| 1312 |
<doc type = "scenario"> |
| 1313 |
The client declares an exchange, binds a queue to it, then tries to delete it |
| 1314 |
setting if-unused to true. |
| 1315 |
</doc> |
| 1316 |
</rule> |
| 1317 |
</field> |
| 1318 |
|
| 1319 |
<field name = "no-wait" domain = "no-wait" /> |
| 1320 |
</method> |
| 1321 |
|
| 1322 |
<method name = "delete-ok" synchronous = "1" index = "21" |
| 1323 |
label = "confirm deletion of an exchange"> |
| 1324 |
<doc>This method confirms the deletion of an exchange.</doc> |
| 1325 |
<chassis name = "client" implement = "MUST" /> |
| 1326 |
</method> |
| 1327 |
</class> |
| 1328 |
|
| 1329 |
|
| 1330 |
|
| 1331 |
<class name = "queue" handler = "channel" index = "50" label = "work with queues"> |
| 1332 |
<doc> |
| 1333 |
Queues store and forward messages. Queues can be configured in the server or created at |
| 1334 |
runtime. Queues must be attached to at least one exchange in order to receive messages |
| 1335 |
from publishers. |
| 1336 |
</doc> |
| 1337 |
|
| 1338 |
<doc type = "grammar"> |
| 1339 |
queue = C:DECLARE S:DECLARE-OK |
| 1340 |
/ C:BIND S:BIND-OK |
| 1341 |
/ C:UNBIND S:UNBIND-OK |
| 1342 |
/ C:PURGE S:PURGE-OK |
| 1343 |
/ C:DELETE S:DELETE-OK |
| 1344 |
</doc> |
| 1345 |
|
| 1346 |
<chassis name = "server" implement = "MUST" /> |
| 1347 |
<chassis name = "client" implement = "MUST" /> |
| 1348 |
|
| 1349 |
|
| 1350 |
|
| 1351 |
<method name = "declare" synchronous = "1" index = "10" label = "declare queue, create if needed"> |
| 1352 |
<doc> |
| 1353 |
This method creates or checks a queue. When creating a new queue the client can |
| 1354 |
specify various properties that control the durability of the queue and its |
| 1355 |
contents, and the level of sharing for the queue. |
| 1356 |
</doc> |
| 1357 |
|
| 1358 |
<rule name = "default-binding"> |
| 1359 |
<doc> |
| 1360 |
The server MUST create a default binding for a newly-declared queue to the |
| 1361 |
default exchange, which is an exchange of type 'direct' and use the queue |
| 1362 |
name as the routing key. |
| 1363 |
</doc> |
| 1364 |
<doc type = "scenario"> |
| 1365 |
Client declares a new queue, and then without explicitly binding it to an |
| 1366 |
exchange, attempts to send a message through the default exchange binding, |
| 1367 |
i.e. publish a message to the empty exchange, with the queue name as routing |
| 1368 |
key. |
| 1369 |
</doc> |
| 1370 |
</rule> |
| 1371 |
|
| 1372 |
<rule name = "minimum-queues"> |
| 1373 |
<doc> |
| 1374 |
The server SHOULD support a minimum of 256 queues per virtual host and ideally, |
| 1375 |
impose no limit except as defined by available resources. |
| 1376 |
</doc> |
| 1377 |
<doc type = "scenario"> |
| 1378 |
Client attempts to declare as many queues as it can until the server reports |
| 1379 |
an error. The resulting count must at least be 256. |
| 1380 |
</doc> |
| 1381 |
</rule> |
| 1382 |
|
| 1383 |
<chassis name = "server" implement = "MUST" /> |
| 1384 |
<response name = "declare-ok" /> |
| 1385 |
|
| 1386 |
|
| 1387 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1388 |
|
| 1389 |
<field name = "queue" domain = "queue-name"> |
| 1390 |
<rule name = "default-name"> |
| 1391 |
<doc> |
| 1392 |
The queue name MAY be empty, in which case the server MUST create a new |
| 1393 |
queue with a unique generated name and return this to the client in the |
| 1394 |
Declare-Ok method. |
| 1395 |
</doc> |
| 1396 |
<doc type = "scenario"> |
| 1397 |
Client attempts to declare several queues with an empty name. The client then |
| 1398 |
verifies that the server-assigned names are unique and different. |
| 1399 |
</doc> |
| 1400 |
</rule> |
| 1401 |
<rule name = "reserved" on-failure = "access-refused"> |
| 1402 |
<doc> |
| 1403 |
Queue names starting with "amq." are reserved for pre-declared and |
| 1404 |
standardised queues. The client MAY declare a queue starting with |
| 1405 |
"amq." if the passive option is set, or the queue already exists. |
| 1406 |
</doc> |
| 1407 |
<doc type = "scenario"> |
| 1408 |
The client attempts to declare a non-existing queue starting with |
| 1409 |
"amq." and with the passive option set to zero. |
| 1410 |
</doc> |
| 1411 |
</rule> |
| 1412 |
<rule name = "syntax" on-failure = "precondition-failed"> |
| 1413 |
<doc> |
| 1414 |
The queue name can be empty, or a sequence of these characters: |
| 1415 |
letters, digits, hyphen, underscore, period, or colon. |
| 1416 |
</doc> |
| 1417 |
<doc type = "scenario"> |
| 1418 |
The client attempts to declare a queue with an illegal name. |
| 1419 |
</doc> |
| 1420 |
</rule> |
| 1421 |
</field> |
| 1422 |
|
| 1423 |
<field name = "passive" domain = "bit" label = "do not create queue"> |
| 1424 |
<doc> |
| 1425 |
If set, the server will reply with Declare-Ok if the queue already |
| 1426 |
exists with the same name, and raise an error if not. The client can |
| 1427 |
use this to check whether a queue exists without modifying the |
| 1428 |
server state. When set, all other method fields except name and no-wait |
| 1429 |
are ignored. A declare with both passive and no-wait has no effect. |
| 1430 |
Arguments are compared for semantic equivalence. |
| 1431 |
</doc> |
| 1432 |
<rule name = "passive" on-failure = "not-found"> |
| 1433 |
<doc> |
| 1434 |
The client MAY ask the server to assert that a queue exists without |
| 1435 |
creating the queue if not. If the queue does not exist, the server |
| 1436 |
treats this as a failure. |
| 1437 |
</doc> |
| 1438 |
<doc type = "scenario"> |
| 1439 |
Client declares an existing queue with the passive option and expects |
| 1440 |
the server to respond with a declare-ok. Client then attempts to declare |
| 1441 |
a non-existent queue with the passive option, and the server must close |
| 1442 |
the channel with the correct reply-code. |
| 1443 |
</doc> |
| 1444 |
</rule> |
| 1445 |
<rule name = "equivalent"> |
| 1446 |
<doc> |
| 1447 |
If not set and the queue exists, the server MUST check that the |
| 1448 |
existing queue has the same values for durable, exclusive, auto-delete, |
| 1449 |
and arguments fields. The server MUST respond with Declare-Ok if the |
| 1450 |
requested queue matches these fields, and MUST raise a channel exception |
| 1451 |
if not. |
| 1452 |
</doc> |
| 1453 |
<doc type = "scenario"> |
| 1454 |
TODO. |
| 1455 |
</doc> |
| 1456 |
</rule> |
| 1457 |
</field> |
| 1458 |
|
| 1459 |
<field name = "durable" domain = "bit" label = "request a durable queue"> |
| 1460 |
<doc> |
| 1461 |
If set when creating a new queue, the queue will be marked as durable. Durable |
| 1462 |
queues remain active when a server restarts. Non-durable queues (transient |
| 1463 |
queues) are purged if/when a server restarts. Note that durable queues do not |
| 1464 |
necessarily hold persistent messages, although it does not make sense to send |
| 1465 |
persistent messages to a transient queue. |
| 1466 |
</doc> |
| 1467 |
|
| 1468 |
<rule name = "persistence"> |
| 1469 |
<doc>The server MUST recreate the durable queue after a restart.</doc> |
| 1470 |
|
| 1471 |
<doc type = "scenario"> |
| 1472 |
Client declares a durable queue. The server is then restarted. The client |
| 1473 |
then attempts to send a message to the queue. The message should be successfully |
| 1474 |
delivered. |
| 1475 |
</doc> |
| 1476 |
</rule> |
| 1477 |
|
| 1478 |
<rule name = "types"> |
| 1479 |
<doc>The server MUST support both durable and transient queues.</doc> |
| 1480 |
<doc type = "scenario"> |
| 1481 |
A client declares two named queues, one durable and one transient. |
| 1482 |
</doc> |
| 1483 |
</rule> |
| 1484 |
</field> |
| 1485 |
|
| 1486 |
<field name = "exclusive" domain = "bit" label = "request an exclusive queue"> |
| 1487 |
<doc> |
| 1488 |
Exclusive queues may only be accessed by the current connection, and are |
| 1489 |
deleted when that connection closes. Passive declaration of an exclusive |
| 1490 |
queue by other connections are not allowed. |
| 1491 |
</doc> |
| 1492 |
|
| 1493 |
<rule name = "types"> |
| 1494 |
<doc> |
| 1495 |
The server MUST support both exclusive (private) and non-exclusive (shared) |
| 1496 |
queues. |
| 1497 |
</doc> |
| 1498 |
<doc type = "scenario"> |
| 1499 |
A client declares two named queues, one exclusive and one non-exclusive. |
| 1500 |
</doc> |
| 1501 |
</rule> |
| 1502 |
|
| 1503 |
<rule name = "exclusive" on-failure = "resource-locked"> |
| 1504 |
<doc> |
| 1505 |
The client MAY NOT attempt to use a queue that was declared as exclusive |
| 1506 |
by another still-open connection. |
| 1507 |
</doc> |
| 1508 |
<doc type = "scenario"> |
| 1509 |
One client declares an exclusive queue. A second client on a different |
| 1510 |
connection attempts to declare, bind, consume, purge, delete, or declare |
| 1511 |
a queue of the same name. |
| 1512 |
</doc> |
| 1513 |
</rule> |
| 1514 |
</field> |
| 1515 |
|
| 1516 |
<field name = "auto-delete" domain = "bit" label = "auto-delete queue when unused"> |
| 1517 |
<doc> |
| 1518 |
If set, the queue is deleted when all consumers have finished using it. The last |
| 1519 |
consumer can be cancelled either explicitly or because its channel is closed. If |
| 1520 |
there was no consumer ever on the queue, it won't be deleted. Applications can |
| 1521 |
explicitly delete auto-delete queues using the Delete method as normal. |
| 1522 |
</doc> |
| 1523 |
|
| 1524 |
<rule name = "pre-existence"> |
| 1525 |
<doc> |
| 1526 |
The server MUST ignore the auto-delete field if the queue already exists. |
| 1527 |
</doc> |
| 1528 |
<doc type = "scenario"> |
| 1529 |
Client declares two named queues, one as auto-delete and one explicit-delete. |
| 1530 |
Client then attempts to declare the two queues using the same names again, |
| 1531 |
but reversing the value of the auto-delete field in each case. Verify that the |
| 1532 |
queues still exist with the original auto-delete flag values. |
| 1533 |
</doc> |
| 1534 |
</rule> |
| 1535 |
</field> |
| 1536 |
|
| 1537 |
<field name = "no-wait" domain = "no-wait" /> |
| 1538 |
|
| 1539 |
<field name = "arguments" domain = "table" label = "arguments for declaration"> |
| 1540 |
<doc> |
| 1541 |
A set of arguments for the declaration. The syntax and semantics of these |
| 1542 |
arguments depends on the server implementation. |
| 1543 |
</doc> |
| 1544 |
</field> |
| 1545 |
</method> |
| 1546 |
|
| 1547 |
<method name = "declare-ok" synchronous = "1" index = "11" label = "confirms a queue definition"> |
| 1548 |
<doc> |
| 1549 |
This method confirms a Declare method and confirms the name of the queue, essential |
| 1550 |
for automatically-named queues. |
| 1551 |
</doc> |
| 1552 |
|
| 1553 |
<chassis name = "client" implement = "MUST" /> |
| 1554 |
|
| 1555 |
<field name = "queue" domain = "queue-name"> |
| 1556 |
<doc> |
| 1557 |
Reports the name of the queue. If the server generated a queue name, this field |
| 1558 |
contains that name. |
| 1559 |
</doc> |
| 1560 |
<assert check = "notnull" /> |
| 1561 |
</field> |
| 1562 |
|
| 1563 |
<field name = "message-count" domain = "message-count" /> |
| 1564 |
|
| 1565 |
<field name = "consumer-count" domain = "long" label = "number of consumers"> |
| 1566 |
<doc> |
| 1567 |
Reports the number of active consumers for the queue. Note that consumers can |
| 1568 |
suspend activity (Channel.Flow) in which case they do not appear in this count. |
| 1569 |
</doc> |
| 1570 |
</field> |
| 1571 |
</method> |
| 1572 |
|
| 1573 |
|
| 1574 |
|
| 1575 |
<method name = "bind" synchronous = "1" index = "20" label = "bind queue to an exchange"> |
| 1576 |
<doc> |
| 1577 |
This method binds a queue to an exchange. Until a queue is bound it will not |
| 1578 |
receive any messages. In a classic messaging model, store-and-forward queues |
| 1579 |
are bound to a direct exchange and subscription queues are bound to a topic |
| 1580 |
exchange. |
| 1581 |
</doc> |
| 1582 |
|
| 1583 |
<rule name = "duplicates"> |
| 1584 |
<doc> |
| 1585 |
A server MUST allow ignore duplicate bindings - that is, two or more bind |
| 1586 |
methods for a specific queue, with identical arguments - without treating these |
| 1587 |
as an error. |
| 1588 |
</doc> |
| 1589 |
<doc type = "scenario"> |
| 1590 |
A client binds a named queue to an exchange. The client then repeats the bind |
| 1591 |
(with identical arguments). |
| 1592 |
</doc> |
| 1593 |
</rule> |
| 1594 |
|
| 1595 |
<rule name = "unique"> |
| 1596 |
<doc> |
| 1597 |
A server MUST not deliver the same message more than once to a queue, even if |
| 1598 |
the queue has multiple bindings that match the message. |
| 1599 |
</doc> |
| 1600 |
<doc type = "scenario"> |
| 1601 |
A client declares a named queue and binds it using multiple bindings to the |
| 1602 |
amq.topic exchange. The client then publishes a message that matches all its |
| 1603 |
bindings. |
| 1604 |
</doc> |
| 1605 |
</rule> |
| 1606 |
|
| 1607 |
<rule name = "transient-exchange"> |
| 1608 |
<doc> |
| 1609 |
The server MUST allow a durable queue to bind to a transient exchange. |
| 1610 |
</doc> |
| 1611 |
<doc type = "scenario"> |
| 1612 |
A client declares a transient exchange. The client then declares a named durable |
| 1613 |
queue and then attempts to bind the transient exchange to the durable queue. |
| 1614 |
</doc> |
| 1615 |
</rule> |
| 1616 |
|
| 1617 |
<rule name = "durable-exchange"> |
| 1618 |
<doc> |
| 1619 |
Bindings of durable queues to durable exchanges are automatically durable |
| 1620 |
and the server MUST restore such bindings after a server restart. |
| 1621 |
</doc> |
| 1622 |
<doc type = "scenario"> |
| 1623 |
A server declares a named durable queue and binds it to a durable exchange. The |
| 1624 |
server is restarted. The client then attempts to use the queue/exchange combination. |
| 1625 |
</doc> |
| 1626 |
</rule> |
| 1627 |
|
| 1628 |
<rule name = "binding-count"> |
| 1629 |
<doc> |
| 1630 |
The server SHOULD support at least 4 bindings per queue, and ideally, impose no |
| 1631 |
limit except as defined by available resources. |
| 1632 |
</doc> |
| 1633 |
<doc type = "scenario"> |
| 1634 |
A client declares a named queue and attempts to bind it to 4 different |
| 1635 |
exchanges. |
| 1636 |
</doc> |
| 1637 |
</rule> |
| 1638 |
|
| 1639 |
<chassis name = "server" implement = "MUST" /> |
| 1640 |
|
| 1641 |
<response name = "bind-ok" /> |
| 1642 |
|
| 1643 |
|
| 1644 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1645 |
|
| 1646 |
<field name = "queue" domain = "queue-name"> |
| 1647 |
<doc>Specifies the name of the queue to bind.</doc> |
| 1648 |
<rule name = "queue-known" on-failure = "not-found"> |
| 1649 |
<doc> |
| 1650 |
The client MUST either specify a queue name or have previously declared a |
| 1651 |
queue on the same channel |
| 1652 |
</doc> |
| 1653 |
<doc type = "scenario"> |
| 1654 |
The client opens a channel and attempts to bind an unnamed queue. |
| 1655 |
</doc> |
| 1656 |
</rule> |
| 1657 |
<rule name = "must-exist" on-failure = "not-found"> |
| 1658 |
<doc> |
| 1659 |
The client MUST NOT attempt to bind a queue that does not exist. |
| 1660 |
</doc> |
| 1661 |
<doc type = "scenario"> |
| 1662 |
The client attempts to bind a non-existent queue. |
| 1663 |
</doc> |
| 1664 |
</rule> |
| 1665 |
</field> |
| 1666 |
|
| 1667 |
<field name = "exchange" domain = "exchange-name" label = "name of the exchange to bind to"> |
| 1668 |
<rule name = "exchange-existence" on-failure = "not-found"> |
| 1669 |
<doc> |
| 1670 |
A client MUST NOT be allowed to bind a queue to a non-existent exchange. |
| 1671 |
</doc> |
| 1672 |
<doc type = "scenario"> |
| 1673 |
A client attempts to bind an named queue to a undeclared exchange. |
| 1674 |
</doc> |
| 1675 |
</rule> |
| 1676 |
<rule name = "default-exchange"> |
| 1677 |
<doc> |
| 1678 |
The server MUST accept a blank exchange name to mean the default exchange. |
| 1679 |
</doc> |
| 1680 |
<doc type = "scenario"> |
| 1681 |
The client declares a queue and binds it to a blank exchange name. |
| 1682 |
</doc> |
| 1683 |
</rule> |
| 1684 |
</field> |
| 1685 |
|
| 1686 |
<field name = "routing-key" domain = "shortstr" label = "message routing key"> |
| 1687 |
<doc> |
| 1688 |
Specifies the routing key for the binding. The routing key is used for routing |
| 1689 |
messages depending on the exchange configuration. Not all exchanges use a |
| 1690 |
routing key - refer to the specific exchange documentation. If the queue name |
| 1691 |
is empty, the server uses the last queue declared on the channel. If the |
| 1692 |
routing key is also empty, the server uses this queue name for the routing |
| 1693 |
key as well. If the queue name is provided but the routing key is empty, the |
| 1694 |
server does the binding with that empty routing key. The meaning of empty |
| 1695 |
routing keys depends on the exchange implementation. |
| 1696 |
</doc> |
| 1697 |
<rule name = "direct-exchange-key-matching"> |
| 1698 |
<doc> |
| 1699 |
If a message queue binds to a direct exchange using routing key K and a |
| 1700 |
publisher sends the exchange a message with routing key R, then the message |
| 1701 |
MUST be passed to the message queue if K = R. |
| 1702 |
</doc> |
| 1703 |
</rule> |
| 1704 |
</field> |
| 1705 |
|
| 1706 |
<field name = "no-wait" domain = "no-wait" /> |
| 1707 |
|
| 1708 |
<field name = "arguments" domain = "table" label = "arguments for binding"> |
| 1709 |
<doc> |
| 1710 |
A set of arguments for the binding. The syntax and semantics of these arguments |
| 1711 |
depends on the exchange class. |
| 1712 |
</doc> |
| 1713 |
</field> |
| 1714 |
</method> |
| 1715 |
|
| 1716 |
<method name = "bind-ok" synchronous = "1" index = "21" label = "confirm bind successful"> |
| 1717 |
<doc>This method confirms that the bind was successful.</doc> |
| 1718 |
|
| 1719 |
<chassis name = "client" implement = "MUST" /> |
| 1720 |
</method> |
| 1721 |
|
| 1722 |
|
| 1723 |
|
| 1724 |
<method name = "unbind" synchronous = "1" index = "50" label = "unbind a queue from an exchange"> |
| 1725 |
<doc>This method unbinds a queue from an exchange.</doc> |
| 1726 |
<rule name = "01"> |
| 1727 |
<doc>If a unbind fails, the server MUST raise a connection exception.</doc> |
| 1728 |
</rule> |
| 1729 |
<chassis name="server" implement="MUST"/> |
| 1730 |
<response name="unbind-ok"/> |
| 1731 |
|
| 1732 |
|
| 1733 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1734 |
|
| 1735 |
<field name = "queue" domain = "queue-name"> |
| 1736 |
<doc>Specifies the name of the queue to unbind.</doc> |
| 1737 |
<rule name = "queue-known" on-failure = "not-found"> |
| 1738 |
<doc> |
| 1739 |
The client MUST either specify a queue name or have previously declared a |
| 1740 |
queue on the same channel |
| 1741 |
</doc> |
| 1742 |
<doc type = "scenario"> |
| 1743 |
The client opens a channel and attempts to unbind an unnamed queue. |
| 1744 |
</doc> |
| 1745 |
</rule> |
| 1746 |
<rule name = "must-exist" on-failure = "not-found"> |
| 1747 |
<doc> |
| 1748 |
The client MUST NOT attempt to unbind a queue that does not exist. |
| 1749 |
</doc> |
| 1750 |
<doc type = "scenario"> |
| 1751 |
The client attempts to unbind a non-existent queue. |
| 1752 |
</doc> |
| 1753 |
</rule> |
| 1754 |
</field> |
| 1755 |
|
| 1756 |
<field name = "exchange" domain = "exchange-name"> |
| 1757 |
<doc>The name of the exchange to unbind from.</doc> |
| 1758 |
<rule name = "must-exist" on-failure = "not-found"> |
| 1759 |
<doc> |
| 1760 |
The client MUST NOT attempt to unbind a queue from an exchange that |
| 1761 |
does not exist. |
| 1762 |
</doc> |
| 1763 |
<doc type = "scenario"> |
| 1764 |
The client attempts to unbind a queue from a non-existent exchange. |
| 1765 |
</doc> |
| 1766 |
</rule> |
| 1767 |
<rule name = "default-exchange"> |
| 1768 |
<doc> |
| 1769 |
The server MUST accept a blank exchange name to mean the default exchange. |
| 1770 |
</doc> |
| 1771 |
<doc type = "scenario"> |
| 1772 |
The client declares a queue and binds it to a blank exchange name. |
| 1773 |
</doc> |
| 1774 |
</rule> |
| 1775 |
</field> |
| 1776 |
|
| 1777 |
<field name = "routing-key" domain = "shortstr" label = "routing key of binding"> |
| 1778 |
<doc>Specifies the routing key of the binding to unbind.</doc> |
| 1779 |
</field> |
| 1780 |
|
| 1781 |
<field name = "arguments" domain = "table" label = "arguments of binding"> |
| 1782 |
<doc>Specifies the arguments of the binding to unbind.</doc> |
| 1783 |
</field> |
| 1784 |
</method> |
| 1785 |
|
| 1786 |
<method name = "unbind-ok" synchronous = "1" index = "51" label = "confirm unbind successful"> |
| 1787 |
<doc>This method confirms that the unbind was successful.</doc> |
| 1788 |
<chassis name = "client" implement = "MUST"/> |
| 1789 |
</method> |
| 1790 |
|
| 1791 |
|
| 1792 |
|
| 1793 |
<method name = "purge" synchronous = "1" index = "30" label = "purge a queue"> |
| 1794 |
<doc> |
| 1795 |
This method removes all messages from a queue which are not awaiting |
| 1796 |
acknowledgment. |
| 1797 |
</doc> |
| 1798 |
|
| 1799 |
<rule name = "02"> |
| 1800 |
<doc> |
| 1801 |
The server MUST NOT purge messages that have already been sent to a client |
| 1802 |
but not yet acknowledged. |
| 1803 |
</doc> |
| 1804 |
</rule> |
| 1805 |
|
| 1806 |
<rule name = "03"> |
| 1807 |
<doc> |
| 1808 |
The server MAY implement a purge queue or log that allows system administrators |
| 1809 |
to recover accidentally-purged messages. The server SHOULD NOT keep purged |
| 1810 |
messages in the same storage spaces as the live messages since the volumes of |
| 1811 |
purged messages may get very large. |
| 1812 |
</doc> |
| 1813 |
</rule> |
| 1814 |
|
| 1815 |
<chassis name = "server" implement = "MUST" /> |
| 1816 |
|
| 1817 |
<response name = "purge-ok" /> |
| 1818 |
|
| 1819 |
|
| 1820 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1821 |
|
| 1822 |
<field name = "queue" domain = "queue-name"> |
| 1823 |
<doc>Specifies the name of the queue to purge.</doc> |
| 1824 |
<rule name = "queue-known" on-failure = "not-found"> |
| 1825 |
<doc> |
| 1826 |
The client MUST either specify a queue name or have previously declared a |
| 1827 |
queue on the same channel |
| 1828 |
</doc> |
| 1829 |
<doc type = "scenario"> |
| 1830 |
The client opens a channel and attempts to purge an unnamed queue. |
| 1831 |
</doc> |
| 1832 |
</rule> |
| 1833 |
<rule name = "must-exist" on-failure = "not-found"> |
| 1834 |
<doc> |
| 1835 |
The client MUST NOT attempt to purge a queue that does not exist. |
| 1836 |
</doc> |
| 1837 |
<doc type = "scenario"> |
| 1838 |
The client attempts to purge a non-existent queue. |
| 1839 |
</doc> |
| 1840 |
</rule> |
| 1841 |
</field> |
| 1842 |
|
| 1843 |
<field name = "no-wait" domain = "no-wait" /> |
| 1844 |
</method> |
| 1845 |
|
| 1846 |
<method name = "purge-ok" synchronous = "1" index = "31" label = "confirms a queue purge"> |
| 1847 |
<doc>This method confirms the purge of a queue.</doc> |
| 1848 |
|
| 1849 |
<chassis name = "client" implement = "MUST" /> |
| 1850 |
|
| 1851 |
<field name = "message-count" domain = "message-count"> |
| 1852 |
<doc> |
| 1853 |
Reports the number of messages purged. |
| 1854 |
</doc> |
| 1855 |
</field> |
| 1856 |
</method> |
| 1857 |
|
| 1858 |
|
| 1859 |
|
| 1860 |
<method name = "delete" synchronous = "1" index = "40" label = "delete a queue"> |
| 1861 |
<doc> |
| 1862 |
This method deletes a queue. When a queue is deleted any pending messages are sent |
| 1863 |
to a dead-letter queue if this is defined in the server configuration, and all |
| 1864 |
consumers on the queue are cancelled. |
| 1865 |
</doc> |
| 1866 |
|
| 1867 |
<rule name = "01"> |
| 1868 |
<doc> |
| 1869 |
The server SHOULD use a dead-letter queue to hold messages that were pending on |
| 1870 |
a deleted queue, and MAY provide facilities for a system administrator to move |
| 1871 |
these messages back to an active queue. |
| 1872 |
</doc> |
| 1873 |
</rule> |
| 1874 |
|
| 1875 |
<chassis name = "server" implement = "MUST" /> |
| 1876 |
|
| 1877 |
<response name = "delete-ok" /> |
| 1878 |
|
| 1879 |
|
| 1880 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 1881 |
|
| 1882 |
<field name = "queue" domain = "queue-name"> |
| 1883 |
<doc>Specifies the name of the queue to delete.</doc> |
| 1884 |
<rule name = "queue-known" on-failure = "not-found"> |
| 1885 |
<doc> |
| 1886 |
The client MUST either specify a queue name or have previously declared a |
| 1887 |
queue on the same channel |
| 1888 |
</doc> |
| 1889 |
<doc type = "scenario"> |
| 1890 |
The client opens a channel and attempts to delete an unnamed queue. |
| 1891 |
</doc> |
| 1892 |
</rule> |
| 1893 |
<rule name = "must-exist" on-failure = "not-found"> |
| 1894 |
<doc> |
| 1895 |
The client MUST NOT attempt to delete a queue that does not exist. |
| 1896 |
</doc> |
| 1897 |
<doc type = "scenario"> |
| 1898 |
The client attempts to delete a non-existent queue. |
| 1899 |
</doc> |
| 1900 |
</rule> |
| 1901 |
</field> |
| 1902 |
|
| 1903 |
<field name = "if-unused" domain = "bit" label = "delete only if unused"> |
| 1904 |
<doc> |
| 1905 |
If set, the server will only delete the queue if it has no consumers. If the |
| 1906 |
queue has consumers the server does does not delete it but raises a channel |
| 1907 |
exception instead. |
| 1908 |
</doc> |
| 1909 |
<rule name = "in-use" on-failure = "precondition-failed"> |
| 1910 |
<doc> |
| 1911 |
The server MUST NOT delete a queue that has consumers on it, if the if-unused |
| 1912 |
field is true. |
| 1913 |
</doc> |
| 1914 |
<doc type = "scenario"> |
| 1915 |
The client declares a queue, and consumes from it, then tries to delete it |
| 1916 |
setting if-unused to true. |
| 1917 |
</doc> |
| 1918 |
</rule> |
| 1919 |
</field> |
| 1920 |
|
| 1921 |
<field name = "if-empty" domain = "bit" label = "delete only if empty"> |
| 1922 |
<doc> |
| 1923 |
If set, the server will only delete the queue if it has no messages. |
| 1924 |
</doc> |
| 1925 |
<rule name = "not-empty" on-failure = "precondition-failed"> |
| 1926 |
<doc> |
| 1927 |
The server MUST NOT delete a queue that has messages on it, if the |
| 1928 |
if-empty field is true. |
| 1929 |
</doc> |
| 1930 |
<doc type = "scenario"> |
| 1931 |
The client declares a queue, binds it and publishes some messages into it, |
| 1932 |
then tries to delete it setting if-empty to true. |
| 1933 |
</doc> |
| 1934 |
</rule> |
| 1935 |
</field> |
| 1936 |
|
| 1937 |
<field name = "no-wait" domain = "no-wait" /> |
| 1938 |
</method> |
| 1939 |
|
| 1940 |
<method name = "delete-ok" synchronous = "1" index = "41" label = "confirm deletion of a queue"> |
| 1941 |
<doc>This method confirms the deletion of a queue.</doc> |
| 1942 |
|
| 1943 |
<chassis name = "client" implement = "MUST" /> |
| 1944 |
|
| 1945 |
<field name = "message-count" domain = "message-count"> |
| 1946 |
<doc>Reports the number of messages deleted.</doc> |
| 1947 |
</field> |
| 1948 |
</method> |
| 1949 |
</class> |
| 1950 |
|
| 1951 |
|
| 1952 |
|
| 1953 |
<class name = "basic" handler = "channel" index = "60" label = "work with basic content"> |
| 1954 |
<doc> |
| 1955 |
The Basic class provides methods that support an industry-standard messaging model. |
| 1956 |
</doc> |
| 1957 |
|
| 1958 |
<doc type = "grammar"> |
| 1959 |
basic = C:QOS S:QOS-OK |
| 1960 |
/ C:CONSUME S:CONSUME-OK |
| 1961 |
/ C:CANCEL S:CANCEL-OK |
| 1962 |
/ C:PUBLISH content |
| 1963 |
/ S:RETURN content |
| 1964 |
/ S:DELIVER content |
| 1965 |
/ C:GET ( S:GET-OK content / S:GET-EMPTY ) |
| 1966 |
/ C:ACK |
| 1967 |
/ C:REJECT |
| 1968 |
/ C:RECOVER-ASYNC |
| 1969 |
/ C:RECOVER S:RECOVER-OK |
| 1970 |
</doc> |
| 1971 |
|
| 1972 |
<chassis name = "server" implement = "MUST" /> |
| 1973 |
<chassis name = "client" implement = "MAY" /> |
| 1974 |
|
| 1975 |
<rule name = "01"> |
| 1976 |
<doc> |
| 1977 |
The server SHOULD respect the persistent property of basic messages and |
| 1978 |
SHOULD make a best-effort to hold persistent basic messages on a reliable |
| 1979 |
storage mechanism. |
| 1980 |
</doc> |
| 1981 |
<doc type = "scenario"> |
| 1982 |
Send a persistent message to queue, stop server, restart server and then |
| 1983 |
verify whether message is still present. Assumes that queues are durable. |
| 1984 |
Persistence without durable queues makes no sense. |
| 1985 |
</doc> |
| 1986 |
</rule> |
| 1987 |
|
| 1988 |
<rule name = "02"> |
| 1989 |
<doc> |
| 1990 |
The server MUST NOT discard a persistent basic message in case of a queue |
| 1991 |
overflow. |
| 1992 |
</doc> |
| 1993 |
<doc type = "scenario"> |
| 1994 |
Declare a queue overflow situation with persistent messages and verify that |
| 1995 |
messages do not get lost (presumably the server will write them to disk). |
| 1996 |
</doc> |
| 1997 |
</rule> |
| 1998 |
|
| 1999 |
<rule name = "03"> |
| 2000 |
<doc> |
| 2001 |
The server MAY use the Channel.Flow method to slow or stop a basic message |
| 2002 |
publisher when necessary. |
| 2003 |
</doc> |
| 2004 |
<doc type = "scenario"> |
| 2005 |
Declare a queue overflow situation with non-persistent messages and verify |
| 2006 |
whether the server responds with Channel.Flow or not. Repeat with persistent |
| 2007 |
messages. |
| 2008 |
</doc> |
| 2009 |
</rule> |
| 2010 |
|
| 2011 |
<rule name = "04"> |
| 2012 |
<doc> |
| 2013 |
The server MAY overflow non-persistent basic messages to persistent |
| 2014 |
storage. |
| 2015 |
</doc> |
| 2016 |
|
| 2017 |
</rule> |
| 2018 |
|
| 2019 |
<rule name = "05"> |
| 2020 |
<doc> |
| 2021 |
The server MAY discard or dead-letter non-persistent basic messages on a |
| 2022 |
priority basis if the queue size exceeds some configured limit. |
| 2023 |
</doc> |
| 2024 |
|
| 2025 |
</rule> |
| 2026 |
|
| 2027 |
<rule name = "06"> |
| 2028 |
<doc> |
| 2029 |
The server MUST implement at least 2 priority levels for basic messages, |
| 2030 |
where priorities 0-4 and 5-9 are treated as two distinct levels. |
| 2031 |
</doc> |
| 2032 |
<doc type = "scenario"> |
| 2033 |
Send a number of priority 0 messages to a queue. Send one priority 9 |
| 2034 |
message. Consume messages from the queue and verify that the first message |
| 2035 |
received was priority 9. |
| 2036 |
</doc> |
| 2037 |
</rule> |
| 2038 |
|
| 2039 |
<rule name = "07"> |
| 2040 |
<doc> |
| 2041 |
The server MAY implement up to 10 priority levels. |
| 2042 |
</doc> |
| 2043 |
<doc type = "scenario"> |
| 2044 |
Send a number of messages with mixed priorities to a queue, so that all |
| 2045 |
priority values from 0 to 9 are exercised. A good scenario would be ten |
| 2046 |
messages in low-to-high priority. Consume from queue and verify how many |
| 2047 |
priority levels emerge. |
| 2048 |
</doc> |
| 2049 |
</rule> |
| 2050 |
|
| 2051 |
<rule name = "08"> |
| 2052 |
<doc> |
| 2053 |
The server MUST deliver messages of the same priority in order irrespective of |
| 2054 |
their individual persistence. |
| 2055 |
</doc> |
| 2056 |
<doc type = "scenario"> |
| 2057 |
Send a set of messages with the same priority but different persistence |
| 2058 |
settings to a queue. Consume and verify that messages arrive in same order |
| 2059 |
as originally published. |
| 2060 |
</doc> |
| 2061 |
</rule> |
| 2062 |
|
| 2063 |
<rule name = "09"> |
| 2064 |
<doc> |
| 2065 |
The server MUST support un-acknowledged delivery of Basic content, i.e. |
| 2066 |
consumers with the no-ack field set to TRUE. |
| 2067 |
</doc> |
| 2068 |
</rule> |
| 2069 |
|
| 2070 |
<rule name = "10"> |
| 2071 |
<doc> |
| 2072 |
The server MUST support explicitly acknowledged delivery of Basic content, |
| 2073 |
i.e. consumers with the no-ack field set to FALSE. |
| 2074 |
</doc> |
| 2075 |
<doc type = "scenario"> |
| 2076 |
Declare a queue and a consumer using explicit acknowledgements. Publish a |
| 2077 |
set of messages to the queue. Consume the messages but acknowledge only |
| 2078 |
half of them. Disconnect and reconnect, and consume from the queue. |
| 2079 |
Verify that the remaining messages are received. |
| 2080 |
</doc> |
| 2081 |
</rule> |
| 2082 |
|
| 2083 |
|
| 2084 |
|
| 2085 |
|
| 2086 |
<field name = "content-type" domain = "shortstr" label = "MIME content type" /> |
| 2087 |
|
| 2088 |
<field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" /> |
| 2089 |
|
| 2090 |
<field name = "headers" domain = "table" label = "message header field table" /> |
| 2091 |
|
| 2092 |
<field name = "delivery-mode" domain = "octet" label = "non-persistent (1) or persistent (2)" /> |
| 2093 |
|
| 2094 |
<field name = "priority" domain = "octet" label = "message priority, 0 to 9" /> |
| 2095 |
|
| 2096 |
<field name = "correlation-id" domain = "shortstr" label = "application correlation identifier" /> |
| 2097 |
|
| 2098 |
|
| 2099 |
<field name = "reply-to" domain = "shortstr" label = "address to reply to" /> |
| 2100 |
|
| 2101 |
<field name = "expiration" domain = "shortstr" label = "message expiration specification" /> |
| 2102 |
|
| 2103 |
<field name = "message-id" domain = "shortstr" label = "application message identifier" /> |
| 2104 |
|
| 2105 |
<field name = "timestamp" domain = "timestamp" label = "message timestamp" /> |
| 2106 |
|
| 2107 |
<field name = "type" domain = "shortstr" label = "message type name" /> |
| 2108 |
|
| 2109 |
<field name = "user-id" domain = "shortstr" label = "creating user id" /> |
| 2110 |
|
| 2111 |
<field name = "app-id" domain = "shortstr" label = "creating application id" /> |
| 2112 |
|
| 2113 |
<field name = "reserved" domain = "shortstr" label = "reserved, must be empty" /> |
| 2114 |
|
| 2115 |
|
| 2116 |
|
| 2117 |
<method name = "qos" synchronous = "1" index = "10" label = "specify quality of service"> |
| 2118 |
<doc> |
| 2119 |
This method requests a specific quality of service. The QoS can be specified for the |
| 2120 |
current channel or for all channels on the connection. The particular properties and |
| 2121 |
semantics of a qos method always depend on the content class semantics. Though the |
| 2122 |
qos method could in principle apply to both peers, it is currently meaningful only |
| 2123 |
for the server. |
| 2124 |
</doc> |
| 2125 |
|
| 2126 |
<chassis name = "server" implement = "MUST" /> |
| 2127 |
<response name = "qos-ok" /> |
| 2128 |
|
| 2129 |
<field name = "prefetch-size" domain = "long" label = "prefetch window in octets"> |
| 2130 |
<doc> |
| 2131 |
The client can request that messages be sent in advance so that when the client |
| 2132 |
finishes processing a message, the following message is already held locally, |
| 2133 |
rather than needing to be sent down the channel. Prefetching gives a performance |
| 2134 |
improvement. This field specifies the prefetch window size in octets. The server |
| 2135 |
will send a message in advance if it is equal to or smaller in size than the |
| 2136 |
available prefetch size (and also falls into other prefetch limits). May be set |
| 2137 |
to zero, meaning "no specific limit", although other prefetch limits may still |
| 2138 |
apply. The prefetch-size is ignored if the no-ack option is set. |
| 2139 |
</doc> |
| 2140 |
<rule name = "01"> |
| 2141 |
<doc> |
| 2142 |
The server MUST ignore this setting when the client is not processing any |
| 2143 |
messages - i.e. the prefetch size does not limit the transfer of single |
| 2144 |
messages to a client, only the sending in advance of more messages while |
| 2145 |
the client still has one or more unacknowledged messages. |
| 2146 |
</doc> |
| 2147 |
<doc type = "scenario"> |
| 2148 |
Define a QoS prefetch-size limit and send a single message that exceeds |
| 2149 |
that limit. Verify that the message arrives correctly. |
| 2150 |
</doc> |
| 2151 |
</rule> |
| 2152 |
</field> |
| 2153 |
|
| 2154 |
<field name = "prefetch-count" domain = "short" label = "prefetch window in messages"> |
| 2155 |
<doc> |
| 2156 |
Specifies a prefetch window in terms of whole messages. This field may be used |
| 2157 |
in combination with the prefetch-size field; a message will only be sent in |
| 2158 |
advance if both prefetch windows (and those at the channel and connection level) |
| 2159 |
allow it. The prefetch-count is ignored if the no-ack option is set. |
| 2160 |
</doc> |
| 2161 |
<rule name = "01"> |
| 2162 |
<doc> |
| 2163 |
The server may send less data in advance than allowed by the client's |
| 2164 |
specified prefetch windows but it MUST NOT send more. |
| 2165 |
</doc> |
| 2166 |
<doc type = "scenario"> |
| 2167 |
Define a QoS prefetch-size limit and a prefetch-count limit greater than |
| 2168 |
one. Send multiple messages that exceed the prefetch size. Verify that |
| 2169 |
no more than one message arrives at once. |
| 2170 |
</doc> |
| 2171 |
</rule> |
| 2172 |
</field> |
| 2173 |
|
| 2174 |
<field name = "global" domain = "bit" label = "apply to entire connection"> |
| 2175 |
<doc> |
| 2176 |
By default the QoS settings apply to the current channel only. If this field is |
| 2177 |
set, they are applied to the entire connection. |
| 2178 |
</doc> |
| 2179 |
</field> |
| 2180 |
</method> |
| 2181 |
|
| 2182 |
<method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos"> |
| 2183 |
<doc> |
| 2184 |
This method tells the client that the requested QoS levels could be handled by the |
| 2185 |
server. The requested QoS applies to all active consumers until a new QoS is |
| 2186 |
defined. |
| 2187 |
</doc> |
| 2188 |
<chassis name = "client" implement = "MUST" /> |
| 2189 |
</method> |
| 2190 |
|
| 2191 |
|
| 2192 |
|
| 2193 |
<method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer"> |
| 2194 |
<doc> |
| 2195 |
This method asks the server to start a "consumer", which is a transient request for |
| 2196 |
messages from a specific queue. Consumers last as long as the channel they were |
| 2197 |
declared on, or until the client cancels them. |
| 2198 |
</doc> |
| 2199 |
|
| 2200 |
<rule name = "01"> |
| 2201 |
<doc> |
| 2202 |
The server SHOULD support at least 16 consumers per queue, and ideally, impose |
| 2203 |
no limit except as defined by available resources. |
| 2204 |
</doc> |
| 2205 |
<doc type = "scenario"> |
| 2206 |
Declare a queue and create consumers on that queue until the server closes the |
| 2207 |
connection. Verify that the number of consumers created was at least sixteen |
| 2208 |
and report the total number. |
| 2209 |
</doc> |
| 2210 |
</rule> |
| 2211 |
|
| 2212 |
<chassis name = "server" implement = "MUST" /> |
| 2213 |
<response name = "consume-ok" /> |
| 2214 |
|
| 2215 |
|
| 2216 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 2217 |
|
| 2218 |
<field name = "queue" domain = "queue-name"> |
| 2219 |
<doc>Specifies the name of the queue to consume from.</doc> |
| 2220 |
</field> |
| 2221 |
|
| 2222 |
<field name = "consumer-tag" domain = "consumer-tag"> |
| 2223 |
<doc> |
| 2224 |
Specifies the identifier for the consumer. The consumer tag is local to a |
| 2225 |
channel, so two clients can use the same consumer tags. If this field is |
| 2226 |
empty the server will generate a unique tag. |
| 2227 |
</doc> |
| 2228 |
<rule name = "01" on-failure = "not-allowed"> |
| 2229 |
<doc> |
| 2230 |
The client MUST NOT specify a tag that refers to an existing consumer. |
| 2231 |
</doc> |
| 2232 |
<doc type = "scenario"> |
| 2233 |
Attempt to create two consumers with the same non-empty tag, on the |
| 2234 |
same channel. |
| 2235 |
</doc> |
| 2236 |
</rule> |
| 2237 |
<rule name = "02" on-failure = "not-allowed"> |
| 2238 |
<doc> |
| 2239 |
The consumer tag is valid only within the channel from which the |
| 2240 |
consumer was created. I.e. a client MUST NOT create a consumer in one |
| 2241 |
channel and then use it in another. |
| 2242 |
</doc> |
| 2243 |
<doc type = "scenario"> |
| 2244 |
Attempt to create a consumer in one channel, then use in another channel, |
| 2245 |
in which consumers have also been created (to test that the server uses |
| 2246 |
unique consumer tags). |
| 2247 |
</doc> |
| 2248 |
</rule> |
| 2249 |
</field> |
| 2250 |
|
| 2251 |
<field name = "no-local" domain = "no-local" /> |
| 2252 |
|
| 2253 |
<field name = "no-ack" domain = "no-ack" /> |
| 2254 |
|
| 2255 |
<field name = "exclusive" domain = "bit" label = "request exclusive access"> |
| 2256 |
<doc> |
| 2257 |
Request exclusive consumer access, meaning only this consumer can access the |
| 2258 |
queue. |
| 2259 |
</doc> |
| 2260 |
|
| 2261 |
<rule name = "01" on-failure = "access-refused"> |
| 2262 |
<doc> |
| 2263 |
The client MAY NOT gain exclusive access to a queue that already has |
| 2264 |
active consumers. |
| 2265 |
</doc> |
| 2266 |
<doc type = "scenario"> |
| 2267 |
Open two connections to a server, and in one connection declare a shared |
| 2268 |
(non-exclusive) queue and then consume from the queue. In the second |
| 2269 |
connection attempt to consume from the same queue using the exclusive |
| 2270 |
option. |
| 2271 |
</doc> |
| 2272 |
</rule> |
| 2273 |
</field> |
| 2274 |
|
| 2275 |
<field name = "no-wait" domain = "no-wait" /> |
| 2276 |
|
| 2277 |
<field name = "arguments" domain = "table" label = "arguments for declaration"> |
| 2278 |
<doc> |
| 2279 |
A set of arguments for the consume. The syntax and semantics of these |
| 2280 |
arguments depends on the server implementation. |
| 2281 |
</doc> |
| 2282 |
</field> |
| 2283 |
</method> |
| 2284 |
|
| 2285 |
<method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer"> |
| 2286 |
<doc> |
| 2287 |
The server provides the client with a consumer tag, which is used by the client |
| 2288 |
for methods called on the consumer at a later stage. |
| 2289 |
</doc> |
| 2290 |
<chassis name = "client" implement = "MUST" /> |
| 2291 |
<field name = "consumer-tag" domain = "consumer-tag"> |
| 2292 |
<doc> |
| 2293 |
Holds the consumer tag specified by the client or provided by the server. |
| 2294 |
</doc> |
| 2295 |
</field> |
| 2296 |
</method> |
| 2297 |
|
| 2298 |
|
| 2299 |
|
| 2300 |
<method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer"> |
| 2301 |
<doc> |
| 2302 |
This method cancels a consumer. This does not affect already delivered |
| 2303 |
messages, but it does mean the server will not send any more messages for |
| 2304 |
that consumer. The client may receive an arbitrary number of messages in |
| 2305 |
between sending the cancel method and receiving the cancel-ok reply. |
| 2306 |
</doc> |
| 2307 |
|
| 2308 |
<rule name = "01"> |
| 2309 |
<doc> |
| 2310 |
If the queue does not exist the server MUST ignore the cancel method, so |
| 2311 |
long as the consumer tag is valid for that channel. |
| 2312 |
</doc> |
| 2313 |
<doc type = "scenario"> |
| 2314 |
TODO. |
| 2315 |
</doc> |
| 2316 |
</rule> |
| 2317 |
|
| 2318 |
<chassis name = "server" implement = "MUST" /> |
| 2319 |
<response name = "cancel-ok" /> |
| 2320 |
|
| 2321 |
<field name = "consumer-tag" domain = "consumer-tag" /> |
| 2322 |
<field name = "no-wait" domain = "no-wait" /> |
| 2323 |
</method> |
| 2324 |
|
| 2325 |
<method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer"> |
| 2326 |
<doc> |
| 2327 |
This method confirms that the cancellation was completed. |
| 2328 |
</doc> |
| 2329 |
<chassis name = "client" implement = "MUST" /> |
| 2330 |
<field name = "consumer-tag" domain = "consumer-tag" /> |
| 2331 |
</method> |
| 2332 |
|
| 2333 |
|
| 2334 |
|
| 2335 |
<method name = "publish" content = "1" index = "40" label = "publish a message"> |
| 2336 |
<doc> |
| 2337 |
This method publishes a message to a specific exchange. The message will be routed |
| 2338 |
to queues as defined by the exchange configuration and distributed to any active |
| 2339 |
consumers when the transaction, if any, is committed. |
| 2340 |
</doc> |
| 2341 |
|
| 2342 |
<chassis name = "server" implement = "MUST" /> |
| 2343 |
|
| 2344 |
|
| 2345 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 2346 |
|
| 2347 |
<field name = "exchange" domain = "exchange-name"> |
| 2348 |
<doc> |
| 2349 |
Specifies the name of the exchange to publish to. The exchange name can be |
| 2350 |
empty, meaning the default exchange. If the exchange name is specified, and that |
| 2351 |
exchange does not exist, the server will raise a channel exception. |
| 2352 |
</doc> |
| 2353 |
|
| 2354 |
<rule name = "must-exist" on-failure = "not-found"> |
| 2355 |
<doc> |
| 2356 |
The client MUST NOT attempt to publish a content to an exchange that |
| 2357 |
does not exist. |
| 2358 |
</doc> |
| 2359 |
<doc type = "scenario"> |
| 2360 |
The client attempts to publish a content to a non-existent exchange. |
| 2361 |
</doc> |
| 2362 |
</rule> |
| 2363 |
<rule name = "default-exchange"> |
| 2364 |
<doc> |
| 2365 |
The server MUST accept a blank exchange name to mean the default exchange. |
| 2366 |
</doc> |
| 2367 |
<doc type = "scenario"> |
| 2368 |
The client declares a queue and binds it to a blank exchange name. |
| 2369 |
</doc> |
| 2370 |
</rule> |
| 2371 |
<rule name = "02"> |
| 2372 |
<doc> |
| 2373 |
If the exchange was declared as an internal exchange, the server MUST raise |
| 2374 |
a channel exception with a reply code 403 (access refused). |
| 2375 |
</doc> |
| 2376 |
<doc type = "scenario"> |
| 2377 |
TODO. |
| 2378 |
</doc> |
| 2379 |
</rule> |
| 2380 |
|
| 2381 |
<rule name = "03"> |
| 2382 |
<doc> |
| 2383 |
The exchange MAY refuse basic content in which case it MUST raise a channel |
| 2384 |
exception with reply code 540 (not implemented). |
| 2385 |
</doc> |
| 2386 |
<doc type = "scenario"> |
| 2387 |
TODO. |
| 2388 |
</doc> |
| 2389 |
</rule> |
| 2390 |
</field> |
| 2391 |
|
| 2392 |
<field name = "routing-key" domain = "shortstr" label = "Message routing key"> |
| 2393 |
<doc> |
| 2394 |
Specifies the routing key for the message. The routing key is used for routing |
| 2395 |
messages depending on the exchange configuration. |
| 2396 |
</doc> |
| 2397 |
</field> |
| 2398 |
|
| 2399 |
<field name = "mandatory" domain = "bit" label = "indicate mandatory routing"> |
| 2400 |
<doc> |
| 2401 |
This flag tells the server how to react if the message cannot be routed to a |
| 2402 |
queue. If this flag is set, the server will return an unroutable message with a |
| 2403 |
Return method. If this flag is zero, the server silently drops the message. |
| 2404 |
</doc> |
| 2405 |
|
| 2406 |
<rule name = "01"> |
| 2407 |
<doc> |
| 2408 |
The server SHOULD implement the mandatory flag. |
| 2409 |
</doc> |
| 2410 |
<doc type = "scenario"> |
| 2411 |
TODO. |
| 2412 |
</doc> |
| 2413 |
</rule> |
| 2414 |
</field> |
| 2415 |
|
| 2416 |
<field name = "immediate" domain = "bit" label = "request immediate delivery"> |
| 2417 |
<doc> |
| 2418 |
This flag tells the server how to react if the message cannot be routed to a |
| 2419 |
queue consumer immediately. If this flag is set, the server will return an |
| 2420 |
undeliverable message with a Return method. If this flag is zero, the server |
| 2421 |
will queue the message, but with no guarantee that it will ever be consumed. |
| 2422 |
</doc> |
| 2423 |
|
| 2424 |
<rule name = "01"> |
| 2425 |
<doc> |
| 2426 |
The server SHOULD implement the immediate flag. |
| 2427 |
</doc> |
| 2428 |
<doc type = "scenario"> |
| 2429 |
TODO. |
| 2430 |
</doc> |
| 2431 |
</rule> |
| 2432 |
</field> |
| 2433 |
</method> |
| 2434 |
|
| 2435 |
<method name = "return" content = "1" index = "50" label = "return a failed message"> |
| 2436 |
<doc> |
| 2437 |
This method returns an undeliverable message that was published with the "immediate" |
| 2438 |
flag set, or an unroutable message published with the "mandatory" flag set. The |
| 2439 |
reply code and text provide information about the reason that the message was |
| 2440 |
undeliverable. |
| 2441 |
</doc> |
| 2442 |
|
| 2443 |
<chassis name = "client" implement = "MUST" /> |
| 2444 |
|
| 2445 |
<field name = "reply-code" domain = "reply-code" /> |
| 2446 |
<field name = "reply-text" domain = "reply-text" /> |
| 2447 |
|
| 2448 |
<field name = "exchange" domain = "exchange-name"> |
| 2449 |
<doc> |
| 2450 |
Specifies the name of the exchange that the message was originally published |
| 2451 |
to. May be empty, meaning the default exchange. |
| 2452 |
</doc> |
| 2453 |
</field> |
| 2454 |
|
| 2455 |
<field name = "routing-key" domain = "shortstr" label = "Message routing key"> |
| 2456 |
<doc> |
| 2457 |
Specifies the routing key name specified when the message was published. |
| 2458 |
</doc> |
| 2459 |
</field> |
| 2460 |
</method> |
| 2461 |
|
| 2462 |
|
| 2463 |
|
| 2464 |
<method name = "deliver" content = "1" index = "60" |
| 2465 |
label = "notify the client of a consumer message"> |
| 2466 |
<doc> |
| 2467 |
This method delivers a message to the client, via a consumer. In the asynchronous |
| 2468 |
message delivery model, the client starts a consumer using the Consume method, then |
| 2469 |
the server responds with Deliver methods as and when messages arrive for that |
| 2470 |
consumer. |
| 2471 |
</doc> |
| 2472 |
|
| 2473 |
<rule name = "01"> |
| 2474 |
<doc> |
| 2475 |
The server SHOULD track the number of times a message has been delivered to |
| 2476 |
clients and when a message is redelivered a certain number of times - e.g. 5 |
| 2477 |
times - without being acknowledged, the server SHOULD consider the message to be |
| 2478 |
unprocessable (possibly causing client applications to abort), and move the |
| 2479 |
message to a dead letter queue. |
| 2480 |
</doc> |
| 2481 |
<doc type = "scenario"> |
| 2482 |
TODO. |
| 2483 |
</doc> |
| 2484 |
</rule> |
| 2485 |
|
| 2486 |
<chassis name = "client" implement = "MUST" /> |
| 2487 |
|
| 2488 |
<field name = "consumer-tag" domain = "consumer-tag" /> |
| 2489 |
<field name = "delivery-tag" domain = "delivery-tag" /> |
| 2490 |
<field name = "redelivered" domain = "redelivered" /> |
| 2491 |
|
| 2492 |
<field name = "exchange" domain = "exchange-name"> |
| 2493 |
<doc> |
| 2494 |
Specifies the name of the exchange that the message was originally published to. |
| 2495 |
May be empty, indicating the default exchange. |
| 2496 |
</doc> |
| 2497 |
</field> |
| 2498 |
|
| 2499 |
<field name = "routing-key" domain = "shortstr" label = "Message routing key"> |
| 2500 |
<doc>Specifies the routing key name specified when the message was published.</doc> |
| 2501 |
</field> |
| 2502 |
</method> |
| 2503 |
|
| 2504 |
|
| 2505 |
|
| 2506 |
<method name = "get" synchronous = "1" index = "70" label = "direct access to a queue"> |
| 2507 |
<doc> |
| 2508 |
This method provides a direct access to the messages in a queue using a synchronous |
| 2509 |
dialogue that is designed for specific types of application where synchronous |
| 2510 |
functionality is more important than performance. |
| 2511 |
</doc> |
| 2512 |
|
| 2513 |
<response name = "get-ok" /> |
| 2514 |
<response name = "get-empty" /> |
| 2515 |
<chassis name = "server" implement = "MUST" /> |
| 2516 |
|
| 2517 |
|
| 2518 |
<field name = "reserved-1" type = "short" reserved = "1" /> |
| 2519 |
|
| 2520 |
<field name = "queue" domain = "queue-name"> |
| 2521 |
<doc>Specifies the name of the queue to get a message from.</doc> |
| 2522 |
</field> |
| 2523 |
<field name = "no-ack" domain = "no-ack" /> |
| 2524 |
</method> |
| 2525 |
|
| 2526 |
<method name = "get-ok" synchronous = "1" content = "1" index = "71" |
| 2527 |
label = "provide client with a message"> |
| 2528 |
<doc> |
| 2529 |
This method delivers a message to the client following a get method. A message |
| 2530 |
delivered by 'get-ok' must be acknowledged unless the no-ack option was set in the |
| 2531 |
get method. |
| 2532 |
</doc> |
| 2533 |
|
| 2534 |
<chassis name = "client" implement = "MAY" /> |
| 2535 |
|
| 2536 |
<field name = "delivery-tag" domain = "delivery-tag" /> |
| 2537 |
<field name = "redelivered" domain = "redelivered" /> |
| 2538 |
<field name = "exchange" domain = "exchange-name"> |
| 2539 |
<doc> |
| 2540 |
Specifies the name of the exchange that the message was originally published to. |
| 2541 |
If empty, the message was published to the default exchange. |
| 2542 |
</doc> |
| 2543 |
</field> |
| 2544 |
|
| 2545 |
<field name = "routing-key" domain = "shortstr" label = "Message routing key"> |
| 2546 |
<doc>Specifies the routing key name specified when the message was published.</doc> |
| 2547 |
</field> |
| 2548 |
|
| 2549 |
<field name = "message-count" domain = "message-count" /> |
| 2550 |
</method> |
| 2551 |
|
| 2552 |
<method name = "get-empty" synchronous = "1" index = "72" |
| 2553 |
label = "indicate no messages available"> |
| 2554 |
<doc> |
| 2555 |
This method tells the client that the queue has no messages available for the |
| 2556 |
client. |
| 2557 |
</doc> |
| 2558 |
<chassis name = "client" implement = "MAY" /> |
| 2559 |
|
| 2560 |
<field name = "reserved-1" type = "shortstr" reserved = "1" /> |
| 2561 |
</method> |
| 2562 |
|
| 2563 |
|
| 2564 |
|
| 2565 |
<method name = "ack" index = "80" label = "acknowledge one or more messages"> |
| 2566 |
<doc> |
| 2567 |
This method acknowledges one or more messages delivered via the Deliver or Get-Ok |
| 2568 |
methods. The client can ask to confirm a single message or a set of messages up to |
| 2569 |
and including a specific message. |
| 2570 |
</doc> |
| 2571 |
|
| 2572 |
<chassis name = "server" implement = "MUST" /> |
| 2573 |
|
| 2574 |
<field name = "delivery-tag" domain = "delivery-tag" /> |
| 2575 |
<field name = "multiple" domain = "bit" label = "acknowledge multiple messages"> |
| 2576 |
<doc> |
| 2577 |
If set to 1, the delivery tag is treated as "up to and including", so that the |
| 2578 |
client can acknowledge multiple messages with a single method. If set to zero, |
| 2579 |
the delivery tag refers to a single message. If the multiple field is 1, and the |
| 2580 |
delivery tag is zero, tells the server to acknowledge all outstanding messages. |
| 2581 |
</doc> |
| 2582 |
<rule name = "exists" on-failure = "precondition-failed"> |
| 2583 |
<doc> |
| 2584 |
The server MUST validate that a non-zero delivery-tag refers to a delivered |
| 2585 |
message, and raise a channel exception if this is not the case. On a transacted |
| 2586 |
channel, this check MUST be done immediately and not delayed until a Tx.Commit. |
| 2587 |
Specifically, a client MUST not acknowledge the same message more than once. |
| 2588 |
</doc> |
| 2589 |
<doc type = "scenario"> |
| 2590 |
TODO. |
| 2591 |
</doc> |
| 2592 |
</rule> |
| 2593 |
</field> |
| 2594 |
</method> |
| 2595 |
|
| 2596 |
|
| 2597 |
|
| 2598 |
<method name = "reject" index = "90" label = "reject an incoming message"> |
| 2599 |
<doc> |
| 2600 |
This method allows a client to reject a message. It can be used to interrupt and |
| 2601 |
cancel large incoming messages, or return untreatable messages to their original |
| 2602 |
queue. |
| 2603 |
</doc> |
| 2604 |
|
| 2605 |
<rule name = "01"> |
| 2606 |
<doc> |
| 2607 |
The server SHOULD be capable of accepting and process the Reject method while |
| 2608 |
sending message content with a Deliver or Get-Ok method. I.e. the server should |
| 2609 |
read and process incoming methods while sending output frames. To cancel a |
| 2610 |
partially-send content, the server sends a content body frame of size 1 (i.e. |
| 2611 |
with no data except the frame-end octet). |
| 2612 |
</doc> |
| 2613 |
</rule> |
| 2614 |
|
| 2615 |
<rule name = "02"> |
| 2616 |
<doc> |
| 2617 |
The server SHOULD interpret this method as meaning that the client is unable to |
| 2618 |
process the message at this time. |
| 2619 |
</doc> |
| 2620 |
<doc type = "scenario"> |
| 2621 |
TODO. |
| 2622 |
</doc> |
| 2623 |
</rule> |
| 2624 |
|
| 2625 |
<rule name = "03"> |
| 2626 |
<doc> |
| 2627 |
The client MUST NOT use this method as a means of selecting messages to process. |
| 2628 |
</doc> |
| 2629 |
<doc type = "scenario"> |
| 2630 |
TODO. |
| 2631 |
</doc> |
| 2632 |
</rule> |
| 2633 |
|
| 2634 |
<chassis name = "server" implement = "MUST" /> |
| 2635 |
|
| 2636 |
<field name = "delivery-tag" domain = "delivery-tag" /> |
| 2637 |
|
| 2638 |
<field name = "requeue" domain = "bit" label = "requeue the message"> |
| 2639 |
<doc> |
| 2640 |
If requeue is true, the server will attempt to requeue the message. If requeue |
| 2641 |
is false or the requeue attempt fails the messages are discarded or dead-lettered. |
| 2642 |
</doc> |
| 2643 |
|
| 2644 |
<rule name = "01"> |
| 2645 |
<doc> |
| 2646 |
The server MUST NOT deliver the message to the same client within the |
| 2647 |
context of the current channel. The recommended strategy is to attempt to |
| 2648 |
deliver the message to an alternative consumer, and if that is not possible, |
| 2649 |
to move the message to a dead-letter queue. The server MAY use more |
| 2650 |
sophisticated tracking to hold the message on the queue and redeliver it to |
| 2651 |
the same client at a later stage. |
| 2652 |
</doc> |
| 2653 |
<doc type = "scenario"> |
| 2654 |
TODO. |
| 2655 |
</doc> |
| 2656 |
</rule> |
| 2657 |
</field> |
| 2658 |
</method> |
| 2659 |
|
| 2660 |
|
| 2661 |
|
| 2662 |
<method name = "recover-async" index = "100" label = "redeliver unacknowledged messages" |
| 2663 |
deprecated = "1"> |
| 2664 |
<doc> |
| 2665 |
This method asks the server to redeliver all unacknowledged messages on a |
| 2666 |
specified channel. Zero or more messages may be redelivered. This method |
| 2667 |
is deprecated in favour of the synchronous Recover/Recover-Ok. |
| 2668 |
</doc> |
| 2669 |
<rule name = "01"> |
| 2670 |
<doc> |
| 2671 |
The server MUST set the redelivered flag on all messages that are resent. |
| 2672 |
</doc> |
| 2673 |
<doc type = "scenario"> |
| 2674 |
TODO. |
| 2675 |
</doc> |
| 2676 |
</rule> |
| 2677 |
<chassis name = "server" implement = "MAY" /> |
| 2678 |
<field name = "requeue" domain = "bit" label = "requeue the message"> |
| 2679 |
<doc> |
| 2680 |
If this field is zero, the message will be redelivered to the original |
| 2681 |
recipient. If this bit is 1, the server will attempt to requeue the message, |
| 2682 |
potentially then delivering it to an alternative subscriber. |
| 2683 |
</doc> |
| 2684 |
</field> |
| 2685 |
</method> |
| 2686 |
|
| 2687 |
|
| 2688 |
|
| 2689 |
<method name = "recover" index = "110" label = "redeliver unacknowledged messages"> |
| 2690 |
<doc> |
| 2691 |
This method asks the server to redeliver all unacknowledged messages on a |
| 2692 |
specified channel. Zero or more messages may be redelivered. This method |
| 2693 |
replaces the asynchronous Recover. |
| 2694 |
</doc> |
| 2695 |
<rule name = "01"> |
| 2696 |
<doc> |
| 2697 |
The server MUST set the redelivered flag on all messages that are resent. |
| 2698 |
</doc> |
| 2699 |
<doc type = "scenario"> |
| 2700 |
TODO. |
| 2701 |
</doc> |
| 2702 |
</rule> |
| 2703 |
<chassis name = "server" implement = "MUST" /> |
| 2704 |
<field name = "requeue" domain = "bit" label = "requeue the message"> |
| 2705 |
<doc> |
| 2706 |
If this field is zero, the message will be redelivered to the original |
| 2707 |
recipient. If this bit is 1, the server will attempt to requeue the message, |
| 2708 |
potentially then delivering it to an alternative subscriber. |
| 2709 |
</doc> |
| 2710 |
</field> |
| 2711 |
</method> |
| 2712 |
|
| 2713 |
<method name = "recover-ok" synchronous = "1" index = "111" label = "confirm recovery"> |
| 2714 |
<doc> |
| 2715 |
This method acknowledges a Basic.Recover method. |
| 2716 |
</doc> |
| 2717 |
<chassis name = "client" implement = "MUST" /> |
| 2718 |
</method> |
| 2719 |
</class> |
| 2720 |
|
| 2721 |
|
| 2722 |
|
| 2723 |
<class name = "tx" handler = "channel" index = "90" label = "work with transactions"> |
| 2724 |
<doc> |
| 2725 |
The Tx class allows publish and ack operations to be batched into atomic |
| 2726 |
units of work. The intention is that all publish and ack requests issued |
| 2727 |
within a transaction will complete successfully or none of them will. |
| 2728 |
Servers SHOULD implement atomic transactions at least where all publish |
| 2729 |
or ack requests affect a single queue. Transactions that cover multiple |
| 2730 |
queues may be non-atomic, given that queues can be created and destroyed |
| 2731 |
asynchronously, and such events do not form part of any transaction. |
| 2732 |
Further, the behaviour of transactions with respect to the immediate and |
| 2733 |
mandatory flags on Basic.Publish methods is not defined. |
| 2734 |
</doc> |
| 2735 |
|
| 2736 |
<rule name = "not multiple queues"> |
| 2737 |
<doc> |
| 2738 |
Applications MUST NOT rely on the atomicity of transactions that |
| 2739 |
affect more than one queue. |
| 2740 |
</doc> |
| 2741 |
</rule> |
| 2742 |
<rule name = "not immediate"> |
| 2743 |
<doc> |
| 2744 |
Applications MUST NOT rely on the behaviour of transactions that |
| 2745 |
include messages published with the immediate option. |
| 2746 |
</doc> |
| 2747 |
</rule> |
| 2748 |
<rule name = "not mandatory"> |
| 2749 |
<doc> |
| 2750 |
Applications MUST NOT rely on the behaviour of transactions that |
| 2751 |
include messages published with the mandatory option. |
| 2752 |
</doc> |
| 2753 |
</rule> |
| 2754 |
|
| 2755 |
<doc type = "grammar"> |
| 2756 |
tx = C:SELECT S:SELECT-OK |
| 2757 |
/ C:COMMIT S:COMMIT-OK |
| 2758 |
/ C:ROLLBACK S:ROLLBACK-OK |
| 2759 |
</doc> |
| 2760 |
|
| 2761 |
<chassis name = "server" implement = "SHOULD" /> |
| 2762 |
<chassis name = "client" implement = "MAY" /> |
| 2763 |
|
| 2764 |
|
| 2765 |
|
| 2766 |
<method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode"> |
| 2767 |
<doc> |
| 2768 |
This method sets the channel to use standard transactions. The client must use this |
| 2769 |
method at least once on a channel before using the Commit or Rollback methods. |
| 2770 |
</doc> |
| 2771 |
<chassis name = "server" implement = "MUST" /> |
| 2772 |
<response name = "select-ok" /> |
| 2773 |
</method> |
| 2774 |
|
| 2775 |
<method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode"> |
| 2776 |
<doc> |
| 2777 |
This method confirms to the client that the channel was successfully set to use |
| 2778 |
standard transactions. |
| 2779 |
</doc> |
| 2780 |
<chassis name = "client" implement = "MUST" /> |
| 2781 |
</method> |
| 2782 |
|
| 2783 |
|
| 2784 |
|
| 2785 |
<method name = "commit" synchronous = "1" index = "20" label = "commit the current transaction"> |
| 2786 |
<doc> |
| 2787 |
This method commits all message publications and acknowledgments performed in |
| 2788 |
the current transaction. A new transaction starts immediately after a commit. |
| 2789 |
</doc> |
| 2790 |
<chassis name = "server" implement = "MUST" /> |
| 2791 |
<response name = "commit-ok" /> |
| 2792 |
|
| 2793 |
<rule name = "transacted" on-failure = "precondition-failed"> |
| 2794 |
<doc> |
| 2795 |
The client MUST NOT use the Commit method on non-transacted channels. |
| 2796 |
</doc> |
| 2797 |
<doc type = "scenario"> |
| 2798 |
The client opens a channel and then uses Tx.Commit. |
| 2799 |
</doc> |
| 2800 |
</rule> |
| 2801 |
</method> |
| 2802 |
|
| 2803 |
<method name = "commit-ok" synchronous = "1" index = "21" label = "confirm a successful commit"> |
| 2804 |
<doc> |
| 2805 |
This method confirms to the client that the commit succeeded. Note that if a commit |
| 2806 |
fails, the server raises a channel exception. |
| 2807 |
</doc> |
| 2808 |
<chassis name = "client" implement = "MUST" /> |
| 2809 |
</method> |
| 2810 |
|
| 2811 |
|
| 2812 |
|
| 2813 |
<method name = "rollback" synchronous = "1" index = "30" |
| 2814 |
label = "abandon the current transaction"> |
| 2815 |
<doc> |
| 2816 |
This method abandons all message publications and acknowledgments performed in |
| 2817 |
the current transaction. A new transaction starts immediately after a rollback. |
| 2818 |
Note that unacked messages will not be automatically redelivered by rollback; |
| 2819 |
if that is required an explicit recover call should be issued. |
| 2820 |
</doc> |
| 2821 |
<chassis name = "server" implement = "MUST" /> |
| 2822 |
<response name = "rollback-ok" /> |
| 2823 |
|
| 2824 |
<rule name = "transacted" on-failure = "precondition-failed"> |
| 2825 |
<doc> |
| 2826 |
The client MUST NOT use the Rollback method on non-transacted channels. |
| 2827 |
</doc> |
| 2828 |
<doc type = "scenario"> |
| 2829 |
The client opens a channel and then uses Tx.Rollback. |
| 2830 |
</doc> |
| 2831 |
</rule> |
| 2832 |
</method> |
| 2833 |
|
| 2834 |
<method name = "rollback-ok" synchronous = "1" index = "31" label = "confirm successful rollback"> |
| 2835 |
<doc> |
| 2836 |
This method confirms to the client that the rollback succeeded. Note that if an |
| 2837 |
rollback fails, the server raises a channel exception. |
| 2838 |
</doc> |
| 2839 |
<chassis name = "client" implement = "MUST" /> |
| 2840 |
</method> |
| 2841 |
</class> |
| 2842 |
|
| 2843 |
</amqp> |