一、JMS規范
JMS即Java消息服務(wù)(Java Message Service)應用程序接口,是一個(gè)Java平臺中關(guān)于面向消息中間件(MOM)的API,用于在兩個(gè)應用程序之間,或分布式系統中發(fā)送消息,進(jìn)行異步通信。Java消息服務(wù)是一個(gè)與具體平臺無(wú)關(guān)的API,絕大多數MOM提供商都對JMS提供支持。
以下是百度百科上關(guān)于JMS的介紹,簡(jiǎn)而言之是JAVA EE規范中的一種,很多消息中間件服務(wù)提供商都對此規范進(jìn)行了實(shí)現,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是流行的、強大的消息服務(wù)器,跨多種語(yǔ)言客戶(hù)端,支持多種協(xié)議,支持JMS1.1規范
三、下載、安裝
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:后臺啟動(dòng),console:前臺啟動(dòng))

4、登錄web console管理后臺
5、創(chuàng )建隊列并發(fā)布查看消息

5.1、點(diǎn)擊queues
5.2、輸入隊列名
5.3、床架隊列
5.4、可以看到剛創(chuàng )建的隊列出現在列表中
5.5、發(fā)送消息給當前隊列
5.6、查看當前隊列的消息列表

6、停止ActiveMq
./activemq stop
聯(lián)系客服