8 Replies Latest reply on May 23, 2004 11:13 AM by adrian.brock

    TODO: JMX Message Listing

      I have added the ability to list messages in queues and topic subscriptions
      using JMX.
      This won't perform very well when there are lots of messages, possiblity even giving
      an OutOfMemoryException.

      The same consideration also applies to the current QueueBrowser implementation.

      Need to add some sort of paging to the list.

        • 1. Re: TODO: JMX Message Listing
          raja05

          Adrian
          Which version is this added to? HEAD?

          Thanks

          • 2. Re: TODO: JMX Message Listing
            raja05

            OOps Sorry, Dint check the change notesfor 3.2.4 before posting this

            • 3. Re: TODO: JMX Message Listing
              raja05

              How about adding a method that sets the number of messages that are retrieved for doing the list operation alone? The browse code could be modified to take in a start and number of messages to return a subset of total number of documents. As of 3.2.2.RC4, only the JMSQueue's browse method is the one calling this, so shouldnt have a lot of dependencies.
              If this looks like the way to proceed, I can take this up.

              • 4. Re: TODO: JMX Message Listing

                At the moment it is just reusing the same code as
                QueueBrowser.browse(...)

                We need a different version for paging
                BasicQueue.browse(Selector, int start, int pageSize) throws JMSException;

                This will avoid loading the entire thing into memory.

                The QueueBrowser should really be using a proxy enumeration rather than
                returning an Array of everything in the Queue.

                • 5. Re: TODO: JMX Message Listing
                  raja05

                  I have a method called
                  public MessageReference[] getMessageReferences(String selector, int pageNum)

                  that can be used for the listing of messages paginated. The user typically passes in the pageNumber(based on the pagesize, see below) containing the list of messages he wants to see.

                  There is a managed method called setPageSize(JMX Managed) that can be used to set the page size for message listings.

                  I was wondering how would a typical client call this? Is it okay to return him an array of message references and let him reconstruct the mssage using messagereference.getMessage() ?
                  How do you envision a typical call to this as this is not something offered by the spec(Or is it?)

                  Thanks

                  • 6. Re: TODO: JMX Message Listing

                    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.

                    • 7. Re: TODO: JMX Message Listing

                       

                      "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

                      • 8. Re: TODO: JMX Message Listing

                        Stephane,

                        I've started a new Thread rather than hijacking this one:
                        http://www.jboss.org/index.html?module=bb&op=viewtopic&t=50050