Problem with MDB on remote queue when using JBoss Messaging

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
  • JBoss Messaging
    • 1.4.x

Issue

  • JBoss Messaging creates a duplicate message each time it attempts to move a message to the DLQ.

Resolution

This is the expected behaviour. The short answer is, you have to specify "useDLQ" activation configuration property to "false", as follows in your MDB configuration :

@ActivationConfigProperty(propertyName="useDLQ", propertyValue="false")

Root Cause

To give you more background information; actually this is not a bug but the expected behaviour. When JBossMQ was used in early JBoss-EAP-4.2 release, it never had proper DLQ processing. Hence, it was done at the container. This process is still in place, even though JBossMessaging does support DLQ processing.

Therefore, the container tries to handle DLQ processing, which breaks the intended behaviour. So, you have to tell the container not to perform DLQ processing by setting "useDLQ" activation config property to "false".

Diagnostic Steps

Steps to reproduce :

1) Remove all messages from DLQ and TestQueue
2) Put 1 message in the TestQueue
3) Check the DLQ before all retries, and the message is there
4) Empty the DLQ another time
5) Put the same message on step 2, and you receive 2 messages this time. The DLQ contains 2 messages also

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.

Comments