在CentOS7.8中安装activemq5.15

一、 概述

本文简要讲述在CentOS7.8中安装activemq5.15。

二、 下载

下载地址:http://archive.apache.org/dist/activemq/
选择:apache-activemq-5.15.9-bin.tar.gz
上传到服务器目录:/usr/local/activemq/

三、 安装

3.1 解压

tar –zxvf apache-activemq-5.15.9-bin.tar.gz

3.2 直接普通启动:

	./activemq start

3.3查看进程

ps -ef|grep activemq|grep -v grep
netstat -anp|grep 61616
lsof -i:61616

3.4 普通关闭:

./activemq stop

3.5 配置开机启动
进入配置JDK环境变量文件加入以下两行代码

[root@localhost /]# vim /etc/profile
export ACTIVEMQ_HOME=/usr/local/activemq
sh $ACTIVEMQ_HOME/bin/activemq start

3.6 安全配置
安全验证有两个概念:1.控制台安全配置;2.JMS服务安全配置。

  1. 控制台安全配置
    打开conf/jetty.xml文件,找到
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
    <property name="name" value="BASIC" />
    <property name="roles" value="user,admin" />
    <!-- set authenticate=false to disable login -->
    <property name="authenticate" value="true" />
</bean>

将"false" 改为"true",重启ActiveMQ 即可。
控制台的登录用户名密码保存在conf/credentials.properties文件中。

activemq.username=system
activemq.password=manager
guest.password=password
  1. JMS服务安全配置
    在安装目录下conf/activemq.xml中:
    添加如下内容:
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="system" password="manager" groups="users,admins"/>
<authenticationUser username="test" password="user@test" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>

四、 问题

通过服务器地址http://192.168.233.124:8161/admin 访问不了
将jetty.xml 中默认的127.0.0.1改成当前服务器的地址就行了
在这里插入图片描述

五、 使用

开发环境IDEA,框架:spring boot,配置文件:

 spring:
 activemq:
   user: test
   password: user@test
   broker-url: tcp://192.168.224.190:61616
   packages:
     #信任所有的包
     trust-all: true
   pool:
     enabled: true
     max-connections: 20
#ActiveMQ 消息主题配置
ActiveMQ:
 queueName: test-queue
 queueName2: test-queue2
 queueName3: test-queue3
 topicName: test-topic
 topicName2: test-topic2
#业务消息接口
 topicAlarm: alarm-topic

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

oyezitan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值