2 Replies Latest reply on Dec 12, 2003 2:21 AM by ejain

    How to check whether a message exists

    ejain

      Is it possible to check a JMS queue to see if a message with a specific JMSCorrelationID, for example, is currently being processed? I noticed that messages that are being processed don't show up when looking at the queue with a QueueBrowser; however I need a simple mechanism to check if a specific message exists or not. Any ideas?

        • 1. Re: How to check whether a message exists
          genman


          JMS queues are fairly queue-like, in that you can't scan if a particular message exists in the queue very easily or very quickly. Once you enqueue the message, you know it exists in the queue, and once you process it you know it is no longer in the queue. You can create a database table to track this information. You insert into the DB when the enqueue takes place, and delete from it when the dequeue takes place.

          • 2. Re: How to check whether a message exists
            ejain

             

            "genman" wrote:

            You can create a database table to track this information.

            Yes, I guess that's the way to go. This solution also allows certain usage statistics to be collected, though a simple solution would have been nice.