1 Reply Latest reply on Nov 17, 2004 2:19 AM by genman

    QueueBrowser

    rajen

      Hi friends,

      I have a problem. Inside an MDB I am using a Queuebrowser to look into the Queue to which MDB listens.The browser have a message selector with the JMSCorrelationID as selecting criteria and the MDB is configured as singleton and the OnMessage() has the transaction attribute as required.

      First I sends 5 messages to a the queue.In the OnMessage method I check the CorelationID of the first message.Then I want to get all the message from the Queue with the JMSCorrelationID same as that of the first messgae.i am using the Queuebrowser with message selector to achieve this.

      My problem is like this..

      Even though I send 5 messages my QueueBrowser only shows he last 3 messages.I cant browse the contents of the second message.
      From the forum I found that the second message will be in the reads ahead stage. So the browser does not show it.
      Is there any way to browse the contents of the second message?

      Thanks in advance.

        • 1. Re: QueueBrowser
          genman


          For what you're doing, I think an MDB is the wrong strategy. What an MDB is for is for processing a single message, I don't even know if consuming additional messages from JMS via the MDB is even allowed by the spec.

          Create yourself a QueueSession and a hash table made up of correlation IDs as keys, lists of Messages as values. Read each message, put each message in the table as you read it.

          Correlation ID is used for finding a /single/ message which is a response, not multiple responses. And how do you know all responses exist? JMSXGroupID and JMSXGroupSeq seem like better properties to use.