6 Replies Latest reply on Nov 7, 2005 5:41 PM by shafieksavahl

    JbossMQ and browsing of Scheduled for Delivery Messages

    shafieksavahl

      Hello

      I am using Jboss 4.0.3 SP1 and I would like to browse messages that are in a queue that have been scheduled for redelivery.

      The scenario is that

      - I have set the RedeliveryDelay on a queue to be 30000 ms
      - A message is processed by an MDB which fails to process the message and throws an EJBException (this is the bahaviour I think I want)
      - Looking at the JBoss implementation of a BasicQueue it seems that the message is then placed in an events object that is used for redelivery scheduling.
      - Once the message is placed in the events object it seems that when you attempt to browse/view messages in the queue, you are unable to view those messages in the events object.
      - I can view the number of messages in the events object by calling the method getScheduledMessageCount, but I do not seem to be able to access the messages themselves.

      I am unable to find anything in the forums that mention anything regarding this. Is there anyway to browse/list these messages.

      Thanks

      Shafiek

        • 1. Re: JbossMQ and browsing of Scheduled for Delivery Messages

          Could you elaborate a little bit more, i.e: how do you want to get the messages?

          • 2. Re: JbossMQ and browsing of Scheduled for Delivery Messages
            shafieksavahl

            Hi arashsun

            When I post messages to a JMS queue I am able to view browse the messages in the queue or using the jmx-console I can list the messages if the messages has not yet been delivered.

            If the messages have been attempted to be delivered, failed and then scheduled for redelivery, then it is not possible to browse the messages, nor is it possible to get a valid queue depth. You can however view the number of sheduledForDelivery by using the jmx-console. It would be nice to be able to browse the messages.

            Shafiek

            • 3. Re: JbossMQ and browsing of Scheduled for Delivery Messages

              Do you by any chance get any exceptions? If you could not see any warning in your log file, could you please change your log to debug and post that portion of your log file close to the time of th execution to me.

              The other question I have is do you have delays when you are reading (Receiving messages)?

              Could you also post your receiving code?

              • 4. Re: JbossMQ and browsing of Scheduled for Delivery Messages
                shafieksavahl

                Hi arashun

                I have an MDB that receives messages from a queue. In some circumstances that MDB calles MessageDrivenContext.setRollbackOnly() if it fails to process the message. I do this so that the message will be redelivered at a later time. I also have a queue with the following configiration


                <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
                30000



                Looking at the jmx-console of a given destination, ie my queue above, I can view the various attributes of a queue and I can also invoke the

                java.util.List listMessages()

                MBean operation which lists the messages. Once can also view the current queue depth of the Queue on the jmx-console. The listMessages and QueueDepth operation/attribute, will only display messages that have not yet been delievered, but does not include those messages that have failed to be delivered and are scheduled for re-delivery.

                As for exceptions, I do not get any nor are there any warnings in the log files.


                I suppose all I was wanting to know is, is there anyway to list the messages that have been scheduled for redelivery.

                Shafiek

                • 5. Re: JbossMQ and browsing of Scheduled for Delivery Messages
                  genman


                  I think somebody prepared a patch for that (do a search) but it may not be available.

                  • 6. Re: JbossMQ and browsing of Scheduled for Delivery Messages
                    shafieksavahl

                    Hi genman

                    Thanks for the info. I will try to hunt around for the patch.

                    Thanks

                    Shafiek