【问题标题】:ActiveMQ Topic policyEntryActiveMQ 主题策略入口
【发布时间】: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


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-31
      • 2017-12-14
      • 2020-11-18
      • 2019-09-15
      • 1970-01-01
      • 1970-01-01
      • 2021-07-22
      • 2019-04-30
      相关资源
      最近更新 更多