【发布时间】:2014-12-02 16:24:41
【问题描述】:
我只是尝试使用 ActiveMQ 队列机制而不是主题。下面的 activemq.xml 配置是否强制任何客户端使用主题而不是队列,我可以忽略 policyEntry topic=">" 吗?我看到有时多个消费者(非常小的百分比)接收相同的消息并处理它的问题。在管理控制台中,它显示我有一个队列。我确实看到默认的 activemq.xml 包含主题和队列的 policyEntry。如果此配置对于基于队列的方法确实无效,则并非所有消息都由多个使用者线程消耗,这有点奇怪。
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" persistent="false">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" >
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
【问题讨论】:
标签: activemq