ActiveMQ主题policyEntry

时间:2014-12-02 06:15:26

标签: activemq

我只是尝试使用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>

1 个答案:

答案 0 :(得分:1)

您指出的行仅表示为所有主题定义了策略

在activemq '>'中,'*'与其他语言的作用相同,即它是所有类型的默认处理程序。

如果您有疑问,可以删除该配置。

由于您的待处理消息stratergy在policyEntry中定义,它将适用于所有主题,而不是队列。

相关问题