最近工作中遇到这样一个问题,希望各位能够给予提示或者方法:
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"/>