activemq安全连接-创新互联

一、定义用户组

10年积累的成都网站设计、做网站、成都外贸网站建设公司经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先制作网站后付款的网站建设流程,更有连云免费网站建设让你可以放心的选择与我们合作。

1.1 simpleAuthenticationPlugin通过在activemq.xml中配置用户组

 
  
    
    
      
      
      
    
  

1.2 通过JAAS来配置用户组

 
   

增加login.config文件

activemq {
    org.apache.activemq.jaas.PropertiesLoginModule required
        org.apache.activemq.jaas.properties.user="users.properties"
        org.apache.activemq.jaas.properties.group="groups.properties"
        reload=true;
};

注:reload设置为true时,用户名和密码在每次请求的时候都会重新加载,即修改之后立即生效。

增加users.properties

system=manager
admin=password
user=password
guest=password
sslclient=CN=localhost, OU=activemq.org, O=activemq.org, L=LA, ST=CA, C=US

增加groups.properties

admins=system,sslclient,client,broker1,broker2
tempDestinationAdmins=system,user,sslclient,client,broker1,broker2
users=system,user,sslclient,client,broker1,broker2
guests=guest

二、queue和topic配置不同角色的读写权限

 
  
  
   
    
    
     
     " read="all" write="all" admin="all"/>
    
    
     
    
    
   
 

注:

configuration的值要与login.config中的设置名称相匹配,如:activemq;

ActiveMQ.Advisory.>以表达式的方式配置的topic一定要设置。因为连接的时候就是这种类型的主题,如果不配置此项话,连接会报错(没有权限)。

二、broker与broker之间的连接


    

参考地址:http://activemq.apache.org/security.html


文章题目:activemq安全连接-创新互联
本文路径:http://pwwzsj.com/article/dgceig.html