Apache之Qpid介紹

P2P理財 軟件 編程語言 通信 創未來 2017-04-19

Apache Qpid™ makes messaging tools that speak AMQP and support many languages and platforms.

AMQP is an open internet protocol for reliably sending and receiving messages. It makes it possible for everyone to build a diverse, coherent messaging ecosystem.

Qpid 是 Apache 開發的一款面向對象的消息中間件,它是一個 AMQP 的實現,可以和其他符合 AMQP 協議的系統進行通信。Qpid 提供了 C++/Python/Java/C# 等主流編程語言的客戶端庫,安裝使用非常方便。相對於其他的 AMQP 實現,Qpid 社區十分活躍,有望成為標準 AMQP 中間件產品。除了符合 AMQP 基本要求之外,Qpid 提供了很多額外的 HA 特性,非常適於集群環境下的消息通信。

Features

1)A flexible and capable reactive messaging API

2)Full control of AMQP 1.0 protocol semantics

3)Portable C implementation with bindings to popular languages

4)Pure-Java implementation

5)Peer-to-peer and brokered messaging

6)Secure communication via SSL and SASL

The challenge

Modern large-scale applications are rarely built as monoliths. Instead, they are built as distributed network applications, with parts of the application in distinct processes and distinct parts of the world.

All the same, the parts need to work together to behave as one reliable application. They need a way to communicate, and they must be able to tolerate failures.

Messaging is a better way

Modern messaging systems aren't the only way to get processes talking. Your application's parts can share a view into a database, or you can use HTTP and REST to expose information. But these approaches have some serious drawbacks. A database is reliable, but it isn't designed to intermediate communication. Its focus is storing data, not moving it between processes. REST helps you communicate efficiently, but it offers no reliability. If the party you're talking to is unavailable, the transmission is dropped.

A store-and-forward messaging system gives you efficient, reliable communication. Message brokers take responsibility for ensuring messages reach their destination, even if the destination is temporarily out of reach. Messaging APIs manage acknowledgments so that no messages are dropped in transit.

Apache之Qpid介紹

通信是一個基本的需求,正如人與人之間需要交流一樣,比較大型的軟件系統也往往需要內部或者外部通信。

在系統間通信最基礎的通信方式是 socket,但 socket 比較底層。使用起來非常不易。如果需要一些高級特性,需要很多的編程負擔。

與 socket 的原始對應,企業級的應用軟件往往有著各種各樣從簡單到複雜的通信需求,表現為不同的通信模型。常見的有:

1)點對點:A 發消息給 B。

2)廣播:A 發給所有其他人的消息

3)組播:A 發給多個但不是所有其他人的消息。

4)Requester/response:類似訪問網頁的通信方式,客戶端發請求並等待,服務端回覆該請求

5)Pub-sub:類似雜誌發行,出版雜誌的人並不知道誰在看這本雜誌,訂閱的人並不關心誰在發表這本雜誌。出版的人只管將信息發佈出去,訂閱的人也只在需要的時候收到該信息。

6)Store-and-forward:存儲轉發模型類似信件投遞,寫信的人將消息寫給某人,但在將信件發出的時候,收信的人並不一定在家等待,也並不知道有消息給他。但這個消息不會丟失,會放在收信者的信箱中。這種模型允許信息的異步交換。

7)其他通信模型

相關推薦

推薦中...