1 Reply Latest reply on Apr 5, 2013 3:38 AM by ataylor

    JMSQueueControl listMessages() - Nothing is ever returned?

    marhat

      Hi,

       

      I would like to examine messages that are currently awaiting delivery in a queue. It seems that this should be possible with the use of listMessages(String filter). However, on calling listMessgaes, i always get back empty results despite there being lots of messages in the queue. I am using 2.2.14.Final in stand-alone, non-clustered mode.

       

      For example:

       

      System.out.println(queueControl.listMessagesAsJSON(null)); would print []

      System.out.println(queueControl.listMessages(null).length); would print 0

       

      I have attempted to get these results with both JMS and JMX approaches and both the same. I know my underlying code is OK as other management functions *do* work. For example,  System.out.println(queueControl.listConsumersAsJSON()); would return something like:

       

      [{"sessionID":"12f738b7-9d5c-11e2-aeb1-d50d57a0d2d5","connectionID":"1684172754","creationTime":1365102955537,"browseOnly":false,"consumerID":0}]

       

      I mention this to avoid folks thinking that I am unable to connect to the JMSQueueControl in the first place.

       

      Am I missing something here? Ultimately I was hoping to be able to retrive the MapMessage's I am adding and perform analysis on some of the map values.

       

      Thanks for any pointers!

        • 1. Re: JMSQueueControl listMessages() - Nothing is ever returned?
          ataylor

          Am I missing something here? Ultimately I was hoping to be able to retrive the MapMessage's I am adding and perform analysis on some of the map values.

          The management methods dont actually return the message, just the properties of the message, i.e. message ID, timestamp etc. If you want to use the actual message you would neeed to use a consumer, maybe a queue browser or a core consumer.

           

          Regarding the fact you dont see any messages, maybe they are buffered on a consumer,its hard to say with out a test or something.