activeMQ安装、配置
如下配置针对activeMQ5.6
一、解压至安装目录 目录结构如下:
|bin|运行脚本目录 |conf|配置文件目录 |data|消息数据保存目录 |doc|说明文档目录 |example|运行实例目录 |lib|JAR包目录 |webapps|自带管理后台目录
二、配置 切换至activeMQ解压目录进入conf 2.1、管理后台登陆用户名、密码配置 ActiveMQ使用的是jetty服務器, 5.8 之前 console 默認密碼不開启,5.8之後秘密默認開启
打開conf/jetty.xml文件,找到
<bean id="securityConstraint" class="org.eclipse.jetty.http.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="admin" />
<property name="authenticate" value="false" />
</bean>
將property name为authenticate的屬性value="false" 改为"true", 控制台的登錄用戶名密碼保存在conf/jetty-realm.properties文件中,內容如下:
# Defines users that can access the web (console, demo, etc.)
# username: password [,rolename ...]
admin: admin, admin
注:用戶名和密碼的格式如下 用戶名 : 密碼 ,角色名
2.2、broker连接用户名、密码配置 2.2.1、加载连接用户名、密码配置文件(5.6默认已有,配置在broker节点元素内)
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>
2.2.2、增加加载验证插件(配置在broker节点元素内)
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="${activemq.username}" password="${activemq.password}" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
2.2.3、打开conf/credentials.properties,添加用户名和密码,如下所示:
activemq.username=admin
activemq.password=showlike
三、启动activeMQ
切换至 安装目录/bin/ 双击activemq.bat运行,如运行正常将看到如下命令窗口:

四、activeMQ监控
管理后台(如2.1步骤配置成功,打开如下链接将提示输入用户名和密码)
admin:http://127.0.0.1:8161/admin/
运行实例 demo:http://127.0.0.1:8161/demo/