3 Replies Latest reply on Sep 15, 2004 9:58 PM by genman

    JMS Newbie: No API to delete messages from queue?

      It doesn't appear that any delete, dequeue, or remove methods exist anywhere to explictly remove messages from queues.

      So, is the easiest thing to do to create a queue specifically for consuming messages and doing nothing with them, essentially deleting them? And whenever one wishes to delete a message, move it to this 'delete' queue?

      Thanks so much!

      --alexx

        • 1. Re: JMS Newbie: No API to delete messages from queue?
          genman


          There is no non-vendor specific way. Take a look at the JMX console, look for your queue. Click on "removeAllMessages", you can do this via JMX. Isn't this a FAQ?

          • 2. Re: JMS Newbie: Edit & resubmit Messages?

            Well, no FAQ entry to delete 1 spec. message, based on message id. I thought it would be handy to browse a queue (since you can) and then based on contents, delete a message based on its ID. But it seems that if I want to do that, I'd have to actually create an MDB to persist the msgs on this queue elsewhere (like a DB) if I'd like to browse AND 1) resubmit 2) edit or 3) delete them from the system.

            I'm fairly new to JMS, so if there is a better way to do this I'd be very open to sugg's.

            Thanks!

            --alexx

            • 3. Re: JMS Newbie: No API to delete messages from queue?
              genman


              JMS is not designed to be good deleting messages from within a Queue. You can use a message selector, but it's not very high performance within JBoss. If in-queue removal is important, you should use a different architecture.