27.01.2014 Views

AMQP Specification Transport

AMQP Specification Transport

AMQP Specification Transport

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Framing<br />

2 Framing<br />

2.1 Frame Layout<br />

A frame encodes a control or a command. Each frame is divided into two distinct areas: a fixed width frame<br />

header, and a variable width frame body containing, when non-empty, an encoded command or control<br />

operation.<br />

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

| frame header | frame body |<br />

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

24 bytes *variable*<br />

frame header: The frame header is a fixed size (24 byte) structure that precedes each<br />

frame. The frame header includes information required to parse the<br />

rest of the frame, as well as key session state variables.<br />

frame body: The frame body, when non-empty, contains a command or control<br />

operation encoded as a struct.<br />

2.2 Frame Header<br />

+0 +1 +2 +3<br />

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

0 | size |<br />

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

4 | type | flags | channel |<br />

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

8 | acknowledged | |<br />

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

12 | executed | |<br />

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

16 | capacity | |<br />

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

20 | command-id | | |<br />

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

|<br />

type: 0x00 - control |<br />

0x01 - command |<br />

|<br />

flags: 0|0|0|0|0|0|0|0 - control |<br />

0|0|0|0|0|0|S|F - command |<br />

|<br />

S: sync flag |<br />

F: flush flag |<br />

-. |<br />

reserved - control |---------------+<br />

session state - command |<br />

-'<br />

size: Bytes 0-3 of the frame header contain the frame size. This is an<br />

unsigned 32-bit integer that MUST contain the total frame size<br />

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

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

Saved successfully!

Ooh no, something went wrong!