美文网首页
《日子》.activemq 队列消息优先级排序

《日子》.activemq 队列消息优先级排序

作者: 战神汤姆 | 来源:发表于2016-12-06 14:30 被阅读0次

    A common requirement is to support priority consumption; so high priority messages are consumed before low priority.
    In version 5.4 priority queues are supported. Both the message cursors and the message stores (KahaDB and JDBC) support message priority. The support is disabled by default so it needs to be be enabled using per destination policies through xml configuration, in the example below, 'prioritizedMessages' is enabled for all queues.
    <code>
    <destinationPolicy>
    <policyMap>
    <policyEntries>
    <policyEntry queue=">" prioritizedMessages="true"/>
    ...
    </code>

    java code:
    <code>
    producer.setPriority(5);
    </code>

    相关文章

      网友评论

          本文标题:《日子》.activemq 队列消息优先级排序

          本文链接:https://www.haomeiwen.com/subject/sqrrmttx.html