一、JMS规范
JMS即Java消息服务(Java Message Service)应用程序接口,是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用程序之间,或分布式系统中发送消息,进行异步通信。Java消息服务是一个与具体平台无关的API,绝大多数MOM提供商都对JMS提供支持。
以下是百度百科上关于JMS的介绍,简而言之是JAVA EE规范中的一种,很多消息中间件服务提供商都对此规范进行了实现,ActiveMQ就是其中一种。
二、ActiveMQ简介
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是流行的、强大的消息服务器,跨多种语言客户端,支持多种协议,支持JMS1.1规范
三、下载、安装
1、下载
官网地址: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环境变量
源码编译,参考http://activemq.apache.org/getting-started.html#GettingStarted-Introduction ,作为初学者,直接用二进制版本。
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:后台启动,console:前台启动)
4、登录web console管理后台
5、创建队列并发布查看消息
5.1、点击queues
5.2、输入队列名
5.3、床架队列
5.4、可以看到刚创建的队列出现在列表中
5.5、发送消息给当前队列
5.6、查看当前队列的消息列表
6、停止ActiveMq
./activemq stop
联系客服