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>
网友评论