1 Reply Latest reply on May 20, 2010 10:00 AM by andreas_back

    JMSXDeliveryCount in message selector and QueueBrowser

    andreas_back Novice



      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:




      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.


      Any advice


      *     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!