activemq安全連接-創(chuàng)新互聯(lián)

一、定義用戶組

10年積累的成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、成都外貿(mào)網(wǎng)站建設(shè)公司經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先制作網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有連云免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

1.1 simpleAuthenticationPlugin通過(guò)在activemq.xml中配置用戶組

<plugins> 
 <simpleAuthenticationPlugin> 
   <users> 
    <authenticationUser username="admin" password="password"  groups="admins,publishers,consumers"/>
     <authenticationUser username="publisher" password="password" groups="publishers,consumers"/> 
     <authenticationUser username="consumer" password="password" groups="consumers"/> 
     <authenticationUser username="guest" password="password" groups="guests"/> 
   </users> 
 </simpleAuthenticationPlugin> 
</plugins>

1.2 通過(guò)JAAS來(lái)配置用戶組

<plugins> 
   <jaasAuthenticationPlugin configuration="activemq-domain" />
</plugins>

增加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設(shè)置為true時(shí),用戶名和密碼在每次請(qǐng)求的時(shí)候都會(huì)重新加載,即修改之后立即生效。

增加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配置不同角色的讀寫(xiě)權(quán)限

<plugins> 
 <jaasAuthenticationPlugin configuration="activemq" /> 
 <authorizationPlugin> 
  <map> 
   <authorizationMap> 
    <authorizationEntries>
     <authorizationEntry queue="yyc-test" read="guests" write="users" admin="admins" />
     <authorizationEntry topic="ActiveMQ.Advisory.>" read="all" write="all" admin="all"/>
    </authorizationEntries>
    <tempDestinationAuthorizationEntry>
     <tempDestinationAuthorizationEntry read="tmpDestinationAdmins" write="tmpDestinationAdmins" admin="tmpDestinationAdmins"/>
    </tempDestinationAuthorizationEntry>
   </authorizationMap> 
  </map> 
 </authorizationPlugin>
</plugins>

注:

configuration的值要與login.config中的設(shè)置名稱相匹配,如:activemq;

ActiveMQ.Advisory.>以表達(dá)式的方式配置的topic一定要設(shè)置。因?yàn)檫B接的時(shí)候就是這種類型的主題,如果不配置此項(xiàng)話,連接會(huì)報(bào)錯(cuò)(沒(méi)有權(quán)限)。

二、broker與broker之間的連接

<networkConnectors>
    <networkConnector 
     name="brokerAbridge"
     userName="user"
    password="password"
    uri="static://(tcp://brokerA:61616)"/>
</networkConnectors>

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

文章題目:activemq安全連接-創(chuàng)新互聯(lián)
分享鏈接:http://www.bm7419.com/article6/dgceig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT標(biāo)簽優(yōu)化、關(guān)鍵詞優(yōu)化虛擬主機(jī)、營(yíng)銷型網(wǎng)站建設(shè)網(wǎng)站排名

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名