RabbitMQ

概念

1、AMQP:Advanced Message Queuing Protocol,是一個(gè)提供統(tǒng)一消息服務(wù)的應(yīng)用層標(biāo)準(zhǔn)協(xié)議。

2、IPC(單一系統(tǒng)進(jìn)程間通信) -> socket(不同機(jī)器間進(jìn)程通信) -> AMQP(解決大型系統(tǒng)模塊與組件間通信)

3、RabbitMQ 基于 Erlang 開(kāi)發(fā),是 AMQP 的一個(gè)開(kāi)源實(shí)現(xiàn)。

4、RabbitMQ 系統(tǒng)架構(gòu)圖:
image

5、名詞術(shù)語(yǔ):

  • RabbitMQ Server(broker server):維護(hù)一條從 Producer 到 Consumer 的路線,保證數(shù)據(jù)能夠按照指定的方式進(jìn)行傳輸;

  • Client A & B:數(shù)據(jù)發(fā)送方,Producers create messages and publish (send) them to a broker server (RabbitMQ),一個(gè)有效的 Message 包含 payload 和 label 兩部分

  • Client 1、2、3:數(shù)據(jù)消費(fèi)方,Consumers attach to a broker server (RabbitMQ) and subscribe to a queue

  • Exchange:Exchanges are where producers publish their messages

  • Queue: Queues are where the messages end up and are received by consumers

  • Binding:Bindings are how the messages get routed from the exchange to particular queues
    還有幾個(gè)隱式的概念:

  • Connection:Producer 和 Consumer 通過(guò) TCP 連接到 RabbitMQ

  • Channel:它建立在上述的 TCP 連接中,數(shù)據(jù)流動(dòng)都是在 Channel 中進(jìn)行的
    此外,Exchanges 分三種類(lèi)型:

  • direct:如果 routing key 匹配,那么 Message 就會(huì)被傳遞到相應(yīng)的 queue

  • fanout:會(huì)向響應(yīng)的 queue 廣播

  • topic:對(duì) key 進(jìn)行模式匹配,比如 ab* 可以傳遞到所有 ab* 的 queue

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容