2013년 5월 7일 화요일

AMQP (Advanced Message Queuing Protocol)

이전 블로그에서 이전 함 (원본 글 2013/05/07 작성)

(작성중)

[Introduction]

AMQP is an open standard application layer protocol for messaging middleware.
AMQP is a standard wire-level protocol and semantic framework for high performance enterprise messaging.

- provides flow controlled, message-oriented communication with message-delivery guarantees.
 : at-most-once (where each message is delivered once or never)
 : at-least-once (where each message is certain to be delivered, but may do so multiple times) 
 : exactly-once (where the message will always certainly arrive and do so only once)
- Authentication / encryption based on SASL / TLS.
- It assumes an underlying reliable transport layer protocol such as Transmission Control Protocol (TCP).


[History]

- AMQP was originated in 2003 by John O'Hara at JPMorgan Chase & Co. in London, UK
- The version history of the AMQP 
  . 0-8, published in June 2006
  . 0-9, published in December 2006
  . 0-10 published in February 2008
  . 0-9-1, published in November 2008. 
   * These earlier releases are significantly different from the final 1.0 specification

AMQP 1.0 was released by the AMQP Working Group on 30 October 2011, at a conference in New York. 
- 1 November 2011, the formation of an OASIS Technical Committee was announced to advance this contributed AMQP version 1.0 through the international open standards process. 
  . The first draft from OASIS was released in February 2012 .
  . The second draft was released for public review on 20 June, 2012 .
  . AMQP was approved as an OASIS standard on the 31st October, 2012 .


[Transport Conceptual Model]

- An AMQP network consists of nodes connected via links. 
 : Nodes are named entities responsible for the safe storage and/or delivery of messages. 
 : Messages can originate from, terminate at, or be relayed by nodes.
- A link is a unidirectional route between two nodes.
- The link protocolmanages the transfer of responsibility between the source and target.

+------------+ +------------+ / Node A \ / Node B \ +----------------+ +--filter +----------------+ | | / | | | MSG_3 <MSG_1> | _/ _ | MSG_1 | | |(_)------------------>(_)| | | <MSG_2> MSG_4 | | | | MSG_2 | | | | Link(Src,Tgt) | | | +----------------+ | | +----------------+ | | Src Tgt Key: <MSG_n> = old location of MSG_n


Nodes exist within a container. 
- Examples of containers are brokers and client applications. 
 : Each container MAY hold many nodes. 
 : Producers and consumers are the elements within an application that generate and process messages. 
 : Queues are entities that store and forward messages.

+---------------+ +----------+ | <<Container>> | 1..1 0..n | <<Node>> | |---------------|<>-------------------->|----------| | container-id | | name | +---------------+ +----------+ /_\ /_\ | | | | +-----+-----+ +----------+----------+ | | | | | | | | | | +--------+ +--------+ +----------+ +----------+ +-------+ | Broker | | Client | | Producer | | Consumer | | Queue | |--------| |--------| |----------| |----------| |-------| | | | | | | | | | | +--------+ +--------+ +----------+ +----------+ +-------+


[Protocol Frames]

Frame Connection Session Link ======================================== open H begin I H attach I H flow I H transfer I H disposition I H detach I H end I H close H ---------------------------------------- Key: H: handled by the endpoint I: intercepted (endpoint examines the frame, but delegates further processing to another endpoint)

[Frame Layout]

REQUIRED OPTIONAL OPTIONAL
+--------------+-----------------+------------+ | frame header | extended header | frame body | +--------------+-----------------+------------+ 8 bytes *variable* *variable*

- General frame layout
+0 +1 +2 +3 +-----------------------------------+ -. 0 | SIZE | | +-----------------------------------+ |---> Frame Header 4 | DOFF | TYPE | <TYPE-SPECIFIC> | | (8 bytes) +-----------------------------------+ -' +-----------------------------------+ -. 8 | ... | | . . |---> Extended Header . <TYPE-SPECIFIC> . | (DOFF * 4-8) bytes | ... | | +-----------------------------------+ -' +-----------------------------------+ -. 4*DOFF | | | . . | . . | . . | . <TYPE-SPECIFIC> . |---> Frame Body . . | (SIZE-DOFF*4) bytes . . | . . | . ________| | | ... | | +--------------------------+ -'


- AMQP frame layout
type: 0x00 - AMQP frame +0 +1 +2 +3 +-----------------------------------+ -. 0 | SIZE | | +-----------------------------------+ |---> Frame Header 4 | DOFF | TYPE | CHANNEL | | (8 bytes) +-----------------------------------+ -' +-----------------------------------+ -. 8 | ... | | . . |---> Extended Header . <IGNORED> . | (DOFF*4-8)bytes | ... | | +-----------------------------------+ -' +-----------------------------------+ -. 4*DOFF | PERFORMATIVE: | | . Open / Begin / Attach . | . Flow / Transfer / Disposition . | . Detach / End / Close . | |-----------------------------------| | . . |---> Frame Body . . | (SIZE-DOFF*4)bytes . PAYLOAD . | . . | . ________| | | ... | | +--------------------------+ -'

[Messaging]
뭔소린지 모르겠다..


- Message format
Bare Message | .-------+-------. | | +---+---+---+---+---+---+---+
| h | d | m | p | a | a | f |
| e | e | e | r | p | p | o |
| a | l | s | o | p | p | o |
| d | i | s | p | l | l | t |
| e | v | a | e | i | i | e |
| r | e | g | r | c | c | r |
| | r | e | t | a | a | |
| | y | | i | t | t | |
| | - | - | e | i | i | |
| | a | a | s | o | o | |
| | n | n |  | n | n | |
| | n | n | | - | - | |
| | o | o | | p | d | |
| | t | t | | r | a | |
| | a | a | | o | t | |
| | t | t | | p | a | |
| | i | i | | e | | |
| | o | o | | t | | |
| | n | n | | i | | |
| | s | s | | e | | |
| | | | | s | | |
+---+---+---+---+---+---+---+
| | '-------------+-------------' | Annotated Message


* 자세한것은 스펙 다시 보는게 빠를듯..




- AMQP became the standard as the OASIS Advanced Message Queuing Protocol


AMQP Working Group License, OASIS copyright


- Advanced Message Queuing Protocol Protocol Specification, Version 0-9-1, 13 November 2008



모르겠다.. 쉽게 볼 수 있는게 아닌것 같다..
프로토콜도 복잡하고  option마다 message format이 다양해서..

댓글 없음:

댓글 쓰기