ActiveMQ簡單介紹

xmh_sxh_1314發表於2020-12-17

在這裡插入圖片描述

訊息通訊的規範JMS,我們這篇博文介紹一款開源的JMS具體實現——ActiveMQ。ActiveMQ是一個易於使用的訊息中介軟體。

訊息中介軟體

我們簡單的介紹一下訊息中介軟體,對它有一個基本認識就好,訊息中介軟體(MOM:Message Orient middleware)。

訊息中介軟體有很多的用途和優點:

  1. 將資料從一個應用程式傳送到另一個應用程式,或者從軟體的一個模組傳送到另外一個模組;
  2. 負責建立網路通訊的通道,進行資料的可靠傳送。
  3. 保證資料不重發,不丟失
  4. 能夠實現跨平臺操作,能夠為不同作業系統上的軟體整合技工資料傳送服務

MQ

首先簡單的介紹一下MQ,MQ英文名MessageQueue,中文名也就是大家用的訊息佇列,幹嘛用的呢,說白了就是一個訊息的接受和轉發的容器,可用於訊息推送。

ActiveMQ特性列表

多種語言和協議編寫客戶端。語言: Java, C, C++, C#, Ruby, Perl, Python, PHP。應用協議: OpenWire,Stomp REST,WS Notification,XMPP,AMQP
完全支援JMS1.1和J2EE 1.4規範 (持久化,XA訊息,事務)
對Spring的支援,ActiveMQ可以很容易內嵌到使用Spring的系統裡面去,而且也支援Spring2.0的特性
通過了常見J2EE伺服器(如 Geronimo,JBoss 4, GlassFish,WebLogic)的測試,其中通過JCA 1.5 resource adaptors的配置,可以讓ActiveMQ可以自動的部署到任何相容J2EE 1.4 商業伺服器上
支援多種傳送協議:in-VM,TCP,SSL,NIO,UDP,JGroups,JXTA
支援通過JDBC和journal提供高速的訊息持久化
從設計上保證了高效能的叢集,客戶端-伺服器,點對點
支援Ajax
支援與Axis的整合
可以很容易得呼叫內嵌JMS provider,進行測試
什麼情況下使用ActiveMQ?

多個專案之間整合
(1) 跨平臺
(2) 多語言
(3) 多專案
降低系統間模組的耦合度,解耦
(1) 軟體擴充套件性
系統前後端隔離
(1) 前後端隔離,遮蔽高安全區

U2FsdGVkX1+5Nt4S6nsmMZsR8Rxge/yTW3lEA6jXBCOCDvLLhOm8iSi9eu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