查找配置文件
find / -name 'activemq.xml'
使用vi编辑器进入文件添加配置
vi /var/lib/docker/overlay2/840c0391f242cb4f6d5876c589da568758d10774703ebd67b44ab1f4e53de888/diff/opt/activemq/conf/activemq.xml
添加配置代码
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="zhangsan" password="123" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
重启activeMQ
springboot中配置文件添加配置
server:
port: 8082
spring:
activemq:
broker-url: tcp://虚拟机ip:61617
user: zhangsan
password: 123
pool:
enabled: true
max-connections: 20