一、JMS規(guī)范
JMS即Java消息服務(wù)(Java Message Service)應(yīng)用程序接口,是一個(gè)Java平臺(tái)中關(guān)于面向消息中間件(MOM)的API,用于在兩個(gè)應(yīng)用程序之間,或分布式系統(tǒng)中發(fā)送消息,進(jìn)行異步通信。Java消息服務(wù)是一個(gè)與具體平臺(tái)無(wú)關(guān)的API,絕大多數(shù)MOM提供商都對(duì)JMS提供支持。
以下是百度百科上關(guān)于JMS的介紹,簡(jiǎn)而言之是JAVA EE規(guī)范中的一種,很多消息中間件服務(wù)提供商都對(duì)此規(guī)范進(jìn)行了實(shí)現(xiàn),ActiveMQ就是其中一種。
二、ActiveMQ簡(jiǎn)介
Apache ActiveMQ ? is the most popular and powerful open source messaging and Integration Patterns server.Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is released under the Apache 2.0 License
按照官方介紹,ActiveMq是流行的、強(qiáng)大的消息服務(wù)器,跨多種語(yǔ)言客戶端,支持多種協(xié)議,支持JMS1.1規(guī)范
三、下載、安裝
1、下載
官網(wǎng)地址:http://activemq.apache.org/download.html
我這邊下載的是linux版本,http://mirror.bit.edu.cn/apache//activemq/5.14.4/apache-activemq-5.14.4-bin.tar.gz
2、安裝的前置條件
如果不從源碼編譯,則只用:jre7、JAVA_HOME環(huán)境變量
源碼編譯,參考http://activemq.apache.org/getting-started.html#GettingStarted-Introduction ,作為初學(xué)者,直接用二進(jìn)制版本。
3、
上傳tar包后解壓到/usr/local
[root@mini1 local]# tar -zxvf apache-activemq-5.14.4-bin.tar.gz -C /usr/local/
[root@mini1 ~]# cd /usr/local/apache-activemq-5.14.4/bin[root@mini1 bin]# ./activemq start(start:后臺(tái)啟動(dòng),console:前臺(tái)啟動(dòng))
4、登錄web console管理后臺(tái)
5、創(chuàng)建隊(duì)列并發(fā)布查看消息
5.1、點(diǎn)擊queues
5.2、輸入隊(duì)列名
5.3、床架隊(duì)列
5.4、可以看到剛創(chuàng)建的隊(duì)列出現(xiàn)在列表中
5.5、發(fā)送消息給當(dāng)前隊(duì)列
5.6、查看當(dāng)前隊(duì)列的消息列表
6、停止ActiveMq
./activemq stop
聯(lián)系客服