Activemq-.xml
1.加載properties配置參數(shù)。下面加載是訪問broker的身份信息,即用戶名和密碼
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>
2.配置broker.同時(shí)brokerName必須唯一
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq-broker" useJmx="true">
3.destination(即queue/topic)的策略
<destinationPolicy></destinationPolicy>
4.限制所有的queue和topic的內(nèi)存大??;是否開啟生產(chǎn)者的流程控制。
<policyEntry queue=">" producerFlowControl="true" memoryLimit="5mb"/>
<policyEntry topic=">" producerFlowControl="true" memoryLimit="5mb">
5.topic類型的分發(fā)策略。即一個(gè)topic生產(chǎn)的主題,嚴(yán)格按照產(chǎn)生的順序被消費(fèi)者接收。并且每個(gè)消費(fèi)者接收的順序都一樣。
<dispatchPolicy>
<strictOrderDispatchPolicy/>
</dispatchPolicy>
strictOrderDispatchPolicy:嚴(yán)格按照產(chǎn)生的順序被消費(fèi);
simpleDispatchPolicy:
roundRobinDispatchPolicy:
priorityNetworkDispatchPolicy:
priorityDispatchPolicy:
6.topic訂閱發(fā)現(xiàn)的策略。
<subscriptionRecoveryPolicy>
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
7.是否暴露JMX接口。
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
8.broker集群
<networkConnectors>
<networkConnector uri="static:(tcp://localhost:61616)" duplex="true"/>
</networkConnectors>
9.broker中的消息存儲(chǔ)方式
<persistenceAdapter>
<kahaDB directory="${activemq.data}/static-broker2/kahadb" />
</persistenceAdapter>
10.activeMQ對(duì)服務(wù)器的資源分配
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
11.本activeMQ服務(wù)對(duì)外的協(xié)議以及端口
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="ws" uri="ws://localhost:61614/" />
</transportConnectors>
12.ssl訪問上下文
<sslContext>
<sslContext keyStore="file:${activemq.conf}/broker.ks"
keyStorePassword="password" trustStore="file:${activemq.conf}/broker.ts"
trustStorePassword="password"/>
</sslContext>
13.activeMQ關(guān)閉時(shí)習(xí)銷毀spring context
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>
14.安全身份設(shè)置
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="system" password="${activemq.password}"
groups="users,admins"/>
<authenticationUser username="user" password="${guest.password}"
groups="users"/>
<authenticationUser username="guest" password="${guest.password}" groups="guests"/>
</users>
</simpleAuthenticationPlugin>
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" read="admins" write="admins" admin="admins" />
<authorizationEntry queue="USERS.>" read="users" write="users" admin="users" />
<authorizationEntry queue="GUEST.>" read="guests" write="guests,users" admin="guests,users" />
<authorizationEntry queue="TEST.Q" read="guests" write="guests" />
<authorizationEntry topic=">" read="admins" write="admins" admin="admins" />
<authorizationEntry topic="USERS.>" read="users" write="users" admin="users" />
<authorizationEntry topic="GUEST.>" read="guests" write="guests,users" admin="guests,users" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="guests,users" write="guests,users" admin="guests,users"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
當(dāng)前題目:ActiveMQ5.14.5配置參數(shù)詳解-創(chuàng)新互聯(lián)
本文路徑:http://m.rwnh.cn/article36/cejcpg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、服務(wù)器托管、App設(shè)計(jì)、做網(wǎng)站、移動(dò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í)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容