A long running application is ported from JBoss MQ (under JBoss 3.2.4) to JBoss Messaging (under JBoss 5.1.0). The queue is used to distribute SOA-like jobs to a cluster of service-units.
1. The service-units shall only accept messages that have not been delivered before:
(JMS_JBOSS_REDELIVERY_COUNT is null or JMS_JBOSS_REDELIVERY_COUNT = 0)
in JBoss MQ under JBoss 3.2.4.
(JMSXDeliveryCount is null or JMSXDeliveryCount < 2)
has not shown any effect in JBoss Messaging.
2. Via a swing admin tool the content of the queue can be observed (by the use of QueueBrowser) and the "delivery_count" shall be read.
With JBoss MQ under JBoss 3.2.4 this was no problem. tm.getJMSRedelivered() did the job. But this method now throws an exception under JBoss Messaging.
Under JBoss Messaging (and JBoss 5.1.0) tm.getStringProperty("JMSXDeliveryCount") always returns null when used with the QueueBrowser.
The QueueBrowser returns JBossTextMessage objects and not the TextMessageProxy, that is returned by the receive method of the MessageConsumer. This may be a reason for the different results of tm.getStringProperty("JMSXDeliveryCount") in the context of the QueueBrowser and the MessageConsumer.
* how to select by a message selector only messages that have not been delivered before
* and how to read the "delivery_count"
in JBoss Messaging is very welcome!
As a workaround we have set
and let JBoss Messaging move the messages to the DLQ. Is avoids JMSXDeliveryCount in the message selectors.