[ActiveMQ] 关于ActiveMQ传输的消息阻塞问题
最近工作中遇到这样一个问题,希望各位能够给予提示或者方法:
1. ActiveMQ的版本是5.1;
2. 我同时用4个客户端向1个服务器的1个队列(队列名称:clinic)写入数据;
3. 经过一段时间(不会超过30分钟)就会发现队列里面仍然有数据,但是消费者不读数据了,客户端也不写数据了。
4. 说明一下,我用的是ActiveMQ自带的配置文件,经过一些修改而已,对生产环境的配置文件不太了解。
我的配置文件内容如下:
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data">
<!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" memoryLimit="5mb" producerFlowControl="true"/>
<policyEntry topic=">" memoryLimit="5mb">
<dispatchPolicy>
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<subscriptionRecoveryPolicy>
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<!-- Use the following to configure how ActiveMQ is exposed in JMX-->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<!-- The store and forward broker networks ActiveMQ will listen to -->
<networkConnectors>
</networkConnectors>
<persistenceAdapter>
<amqPersistenceAdapter directory="${activemq.base}/data" maxFileLength="256 mb" indexBinSize="10240" indexPageSize="1024kb"/>
</persistenceAdapter>
<!-- The maximum about of space the broker will use before slowing down producers -->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="100 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="2 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:44444?wireFormat.maxInactivityDuration=-1" />
</transportConnectors>
</broker>
[解决办法]
同求該問題