27.01.2014 Views

AMQP Specification Transport

AMQP Specification Transport

AMQP Specification Transport

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>AMQP</strong> <strong>Specification</strong>.<br />

Session<br />

Snapshot of a Session<br />

Endpoint<br />

Endpoint<br />

+- - - - - - - - - + +- - - - - - - - +<br />

| Receiver | /| Receiver |\<br />

/ +------------------+ \ / +----------------+ \<br />

/ / \ \ / / \ \<br />

/ / \ \ / / \ \<br />

/ / \ \ / / \ \<br />

/ / \ \ / / \ \<br />

/ / replay buffer \ \ / / input buffer \ \<br />

+------------+---------------------+ +------------+-------------------+<br />

| ... C2 C3 | C4 C5 C6 C7 C8 C9 | | ... C3 C4 | C5 C6 | __ __ |<br />

+------------+---------------------+ +------------+-------------------+<br />

acknowledged | | | executed | received |<br />

+-----+ | +-------------------+<br />

| | |<br />

+ + capacity<br />

/ \<br />

in-flight* blocked<br />

C1, C2, C3: executed by the receiver, and acknowledged at the sender<br />

C4: executed by the receiver, but not acknowledged at the sender<br />

C5, C6: received, but not yet executed by the receiver<br />

C7, C8: transmitted by the sender, but not yet received (in-flight)*<br />

C9: held by the sender awaiting capacity at the receiver<br />

* Note that should a network failure occur at this instant, the<br />

in-flight commands will be lost. In practice, neither the<br />

sender nor receiver knows explicitly which of the<br />

unacknowledged commands will be lost should a network failure<br />

occur.<br />

4.9 Sender State<br />

acknowledged: The id of the last command acknowledged. This marks the head of the<br />

replay buffer.<br />

next-command: The id that will be assigned to the next command sent on the session.<br />

This marks the tail of the replay buffer. The id of any command in the<br />

replay buffer must fall between acknowledged and next-command:<br />

acknowledged < C.id < next-command for all C in the replay buffer<br />

4.10 Receiver State<br />

executed: The id of the last command executed. This marks the head of the input<br />

buffer.<br />

received: The id of the last command received. This marks the end of the filled<br />

slots in the input buffer.<br />

capacity: The capacity of the input buffer. The sum of executed and capacity is<br />

the id of the command that will fill the last slot in the input buffer.<br />

Session endpoints periodically exchange "executed", "capacity", and "acknowledged". Each endpoint uses<br />

the knowledge of its partner's executed state to shrink the replay buffer for outgoing commands. Each<br />

<strong>AMQP</strong> <strong>Transport</strong> v. 1-0 Page 27 of 83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!