activemq配置


<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- START SNIPPET: example -->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>

<!-- Allows accessing the server log -->
<bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
lazy-init="false" scope="singleton"
init-method="start" destroy-method="stop">
</bean>

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">

<networkConnectors>
<!--
<networkConnector uri="static:(tcp://172.16.7.17:61616,tcp://172.16.7.18:61616)" duplex="true"/>

<networkConnector uri="static:(nio://172.16.7.17:1888,nio://172.16.7.18:1889)" duplex="true"/>
<networkConnector uri="static:(tcp://172.16.7.17:1883,tcp://172.16.7.18:1883)" duplex="true"/>-->
</networkConnectors>

<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" >
<!--topic将会在存储空间不足时 暂存50000条消息-->
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="50000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<!--配置为每个队列、每个Topic配置了一个最大500mb的队列,并且使用了”optimizedDispatch=true”这个策略,该策略会启用优化了的消息分发器,直接减少消息来回时的上下文以加快消息分发速度。-->
<policyEntry queue=">" producerFlowControl="false" optimizedDispatch="true" memoryLimit="500mb">
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>


<managementContext>
<managementContext createConnector="false"/>
</managementContext>

<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>

<systemUsage>
<!--如果broker没有存储空间 将会阻塞生产者3秒,之后如果还是没有空间,将会在生产方抛出异常-->
<systemUsage sendFailIfNoSpaceAfterTimeout="3000">
<memoryUsage>
<!--此处百分比 为/bin/env 设置的堆栈百分比-->
<memoryUsage percentOfJvmHeap="90" />
</memoryUsage>
<storeUsage>
<storeUsage limit="100 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="50 gb"/>
</tempUsage>
</systemUsage>
</systemUsage>

<transportConnectors>
<!--只保留1887 nio的监听-->
<transportConnector name="auto+nio" uri="auto+nio://0.0.0.0:1887?maximumConnections=20000&wireFormat.maxFrameSize=104857600&org.apache.activemq.transport.nio.SelectorManager.corePoolSize=200&org.apache.activemq.transport.nio.SelectorManager.maximumPoolSize=150"/>
</transportConnectors>

<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>

</broker>

<import resource="jetty.xml"/>

</beans>
<!-- END SNIPPET: example -->
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

annan211

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值