4 Replies Latest reply on May 23, 2004 11:40 AM by stephanenicoll

    Message Removal

       

      "StephaneNicoll" wrote:
      "adrian@jboss.org" wrote:
      It is intended to be used via JMX not JMS.

      It should not show MessageReference[], it should show a List of SpyMessages
      see the current implementation of listMessages.

      MessageReference is a serverside class.

      Using a List makes it easy for the JMX console to display the results.


      Adrian,

      We have some code that removes messages from a queue based on selector with a limit. If you want we can provide a patch that adds this functionnality (to BasicQueue I assume).

      Regards,

      Stephane


        • 1. Re: Message Removal

          Yes, it should follow the pattern for listMessages,
          i.e. be exposed as a management operation on
          org.jboss.mq.server.jmx.Queue and
          org.jboss.mq.server.jmx.Topic (with an optional extra parameter to identify the subscription).

          What do you do about messages that have been received by the client but not acknowledged? e.g. removeAllMessages() also removes these, but this may not
          be behaviour you want?

          I've been thinking about adding an optional parameter:
          void removeAllMessages(boolean includingUnackedMessages);

          • 2. Re: Message Removal

            Adrian,

            We use only this functionnality on queue. Basically we have a JmsUtilService Mbean which does some operations on queue.

            Namely we have a method

            removeMessages(Queue queue, String selector, int limit) that removes max "limit" messages matching the specified selector on specified queue. Of course, if exposed directly on the destination level we can remove the queue parameter.

            I don't get you with this unacknowledged thing.

            Regards,

            Stephane

            • 3. Re: Message Removal

              See BasicQueue.removeAllMessages()

              • 4. Re: Message Removal

                Ah ok. Well actually, we remove messages by simply consuming them (QueueReceiver). So the unacknowledged stuff makes no sense in this case.

                Regards,

                Stephane