Activemq安全性配置
原文地址:http://blog.csdn.net/ichsonx/article/details/8540004
http://blog.csdn.net/scorpio3k/article/details/5860433
----------------------------------------------------------------------------------------------------------------------------------
AMQ的安全配置分为:AMQ Broker(连接服务安全配置)和AMQ Console(控制台安全配置)两部分;
----------------------------------------------------------------------------------------------------------------------------------
1.控制台安全配置
ActiveMQ使用的是jetty服务器, 打开conf/jetty.xml文件,找到
ConnectionFactory cf = new ActiveMQConnectionFactory("logcd", "028cd", "tcp://195.2.199.169:61616")
- <bean id="queueConnectionFactory"
- class="org.apache.activemq.spring.ActiveMQConnectionFactory" >
- <property name="brokerURL" value="tcp://195.2.199.169:61616" />
- <property name="userName" value="logcd" />
- <property name="password" value="028cd" />
- <property name="useAsyncSend" value="true"/>
- </bean>
2.2 JAAS身份验证
2.2.1 .在conf/activemq.xml文件 borker 标签中加入 配置使用JAAS策略,并定义配置模块为activemq-domain.
- <plugins>
- <!--use JAAS to authenticate using the login.config file on the classpath to configure JAAS -->
- <jaasAuthenticationPlugin configuration="activemq-domain" />
- <!-- lets configure a destination based authorization mechanism -->
- <authorizationPlugin>
- <map>
- <authorizationMap>
- <authorizationEntries>
- <!-->表示通配符,例如USERS.>表示以USERS.开头的主题,>表示所有主题,read表示读的权限,write表示写的权限,admin表示角色组-->
- <authorizationEntry queue=">" read="admins" write="admins" admin="admins" />
- <authorizationEntry topic=">" read="admins" write="admins" admin="admins" />
- <authorizationEntry queue="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins" />
- <authorizationEntry topic="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins" />
- </authorizationEntries>
- </authorizationMap>
- </map>
- </authorizationPlugin>
- </plugins>
login.config 内容如下:
- activemq-domain {
- org.apache.activemq.jaas.PropertiesLoginModule required
- debug=true
- org.apache.activemq.jaas.properties.user="users.properties"
- org.apache.activemq.jaas.properties.group="groups.properties";
- };
- #group=userName
- admins=system
- #userName=password
- system=manager
相关推荐
胡献根 2020-07-18
胡献根 2020-07-05
jiangtie 2020-06-10
onlylixiaobei 2020-06-09
xinglun 2020-06-02
方新德 2020-05-31
Java高知 2020-05-20
Java高知 2020-05-08
Java高知 2020-05-03
onlylixiaobei 2020-05-02
Java高知 2020-04-22
胡献根 2020-04-22
heweiyabeijing 2020-04-21
方新德 2020-04-20
胡献根 2020-04-10
onlylixiaobei 2020-04-10
方新德 2020-04-08
xuedabao 2020-03-30