wiki:wade/messageQueue

概念

為了能讓分散的電腦之間的應用程式能互相交換大量、非同步訊息,如果訊息接收端離線或暫時無法接收檔案,則系統必須能讓訊息在接收端上線時被接收。

系統需求:

  • 必須保證資料能完整到達。
  • 傳送資訊必須保密。
  • 不能佔用太多系統效能,且能持續擴充使用者和訊息。
  • 系統必須夠穩定,且有足夠的容錯性保持資料傳輸。
  • 系統必須提供監視及管理訊息工具及錯誤回報功能。



Advance Message Queuing Protocol (AMQP)

AMQP 是一個網路通訊協定,為了使 client 能透過一個中介軟體來互相傳遞訊息。

AMQP MODEL 三種連接方式

  • Exchange: 由 publisher applications 接收訊息且訊息發送到 message queues,一般都是傳送訊息屬性及內容。
  • Message queue: 用來儲存訊息,直到這些訊息能安全的被 client 處理。
  • Binding: 定義 message queue 、 exchange 的關係,並且是供訊息傳送的準則。

AMQP Protocol

Model layer messages、queues、exchanges、access control、transactions、data types 定義給 application 使用的指令
Session layer commands、control、excepions、confirmation、completion、replay、synchroniation 提供 application 至 server 間可靠的傳輸指令、back with replay、synchroniation、err handling
Transport layer Data Encoding、Framing、Failure Detection、Multiplexing 提供 framing、channel multiplexing、錯誤偵測、data representation、

AMQP MODEL

                               Server
                  +-------------------------------+
                  |          Virtual host         |
                  |   +-----------------------+   |
                  |   |                       |   |
+-------------+   |   |     +-----------+     |   |
| Publisher   | ----------> | Exchange  |     |   |
| Application |   |   |     +-----+-----+     |   |
+-------------+   |   |           |           |   |
                  |   |           |           |   |
                  |   |           | Binding   |   |
                  |   |           |           |   |
                  |   |          \|/          |   |
+-------------+   |   |      +---------+      |   |
| Consumer    | <----------- | Message |      |   |
| Application |   |   |      | Queue   |      |   |
+-------------+   |   |      +---------+      |   |
                  |   +-----------------------+   |
                  +-------------------------------+



專有名詞

  • AMQP Technical Terminology: AMQP 專有名詞
  • MOM 「Message-Oriented Middleware」 訊息導向中介軟體:client/server 架構式的訊息傳遞。
  • AMQP 「Advance Message Queuing Protocol」
  • JMS 「Java Message Service」

Implementation / provider

Reference

Last modified 12 years ago Last modified on Mar 9, 2012, 6:32:56 PM