修改配置文件
位置:
apache-activemq-5.9.0/conf/
vi activemq.xml
在<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
下面添加一段:
<plugins> <!-- use JAAS to authenticate using the login.config file on the classpath to configure JAAS --> <!-- 添加 jaas 认证插件 activemq 在 login.config 里面定义,详细见 login.config--> <jaasAuthenticationPlugin configuration="activemq"/> <!-- lets configure a destination based authorization mechanism --> <authorizationPlugin> <map> <authorizationMap> <authorizationEntries> <authorizationEntry topic=">" read="admins" write="admins" admin="admins" /> <authorizationEntry queue=">" read="admins" write="admins" admin="admins"/> <authorizationEntry topic="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins"/> <authorizationEntry queue="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins"/> </authorizationEntries> </authorizationMap> </map> </authorizationPlugin> </plugins>
重新启动activemq
先关闭,再启动
用户信息在
users.properties
角色分组信息在
groups.properties