iT邦幫忙

第 11 屆 iT 邦幫忙鐵人賽

DAY 22
0

八、通訊與協定

接下來,我們不滿足 FloraMQ 只能為一個系統服務,嘗試拉高它的層級、期許它獨立為一個服務,作為不同系統之間資料交換的中繼點。

遇到的第一個關卡,就是不同系統之間要如何與 FloraMQ 通訊,並交換資料。

就像一個只會說中文的人,到不同語言的異鄉旅遊時,與其他同團的人失散。他與當地人,只有用比手劃腳的方式,才能有效溝通。那肢體語言,就是兩者間的共同語言。

同樣的,不同系統之間的資料溝通與交換,也必須找出或定義共同的語言,或稱為協定。

Remote Procedure Call, RPC

只要提到分散式系統,RPC 這個名詞就必定會被提到,尤其是 Google 提出的 gRPC 後,就更多人聽到這個名詞。

RPC 全稱 Remote Procedure Call,先來看一下,WIKI 的說明:

RPC is a request–response protocol. An RPC is initiated by the client , which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process.

Advanced Message Queuing Protocol , AMQP

若使用 RabbitMQ ,必定對 AMQP 這名詞不陌生,Wiki 是如此介紹。

AMQP is a binary, application layer protocol, designed to efficiently support a wide variety of messaging applications and communication patterns. It provides flow controlled,message-oriented communication with message-delivery guarantees such as 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) and exactly-once (where the message will always certainly arrive and do so only once), and authentication and/or encryption based on SASL and/or TLS. It assumes an underlying reliable transport layer protocol such as Transmission Control Protocol (TCP).

Message Queuing Telemetry Transpor, MQTT

若有在研究 IoT ,多少會聽到 MQTT 這名詞。來看看 Wiki 是如何介紹 MQTT。

MQTT[2] (Message Queuing Telemetry Transport) is an ISO standard (ISO/IEC PRF 20922)[3] publish-subscribe-based messaging protocol. It works on top of the TCP/IP protocol suite. It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth is limited. The publish-subscribe messaging pattern requires a message broker.

延伸閱讀

  1. 谁能用通俗的语言解释一下什么是 RPC 框架
  2. 远程过程调用(RPC)详解
  3. [ Protocol ] 認識 MQTT

上一篇
七、功能整合與函式庫開發規劃(2)
下一篇
九、需求與框架規劃(1)
系列文
從零開始土炮MQ30

尚未有邦友留言

立即登入留言