Messages not getting dispatched to their priority
Environment
- JBoss A-MQ 6.1
- JBoss A-MQ 6.0
Issue
We have enabled support for message priority as per the ActiveMQ documentation.
<policyEntry queue="Prioritized.Queue" prioritizedMessages="true" queuePrefetch="1"
expireMessagesPeriod="0">
<deadLetterStrategy>
<sharedDeadLetterStrategy processExpired="false" />
</deadLetterStrategy>
</policyEntry>
However messages with higher priority still don't get dispatched before messages with default priority.
Resolution
There are two related bugs ENTMQ-818 and ENTMQ-872.
To resolve bug ENTMQ-818, it is also required to set maxPageSize="1" if dispatching messages in strict priority order needs to be enforced. So the configuration becomes
<policyEntry queue="Prioritized.Queue" prioritizedMessages="true" queuePrefetch="1"
expireMessagesPeriod="0" maxPageSize="1">
<deadLetterStrategy>
<sharedDeadLetterStrategy processExpired="false" />
</deadLetterStrategy>
</policyEntry>
Bug ENTMQ-872 captures the same problem but deals with non-persistent messages. Using maxPageSize="1" does not help in this case and no known work around exists at the time of writing.
Root Cause
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
