3 Replies Latest reply on May 1, 2008 4:08 AM by ssjboss

    monitoring msg updates via queues

      Does anyone know if there is a way to get the current amount of msgs going in a queue.

      So if i am pushing in msgs into the queue, i want to get the running amount going in.

        • 1. Re: monitoring msg updates via queues
          ssjboss

          please try this

          qbrowser = qsession.createBrowser(queue);
          Enumeration e = qbrowser.getEnumeration(); // gets list of messages.

          while (e.hasMoreElements()) {
          // counter variable
          }

          -------
          SS

          • 2. Re: monitoring msg updates via queues
            timfox

             

            "ssjboss" wrote:
            please try this

            qbrowser = qsession.createBrowser(queue);
            Enumeration e = qbrowser.getEnumeration(); // gets list of messages.

            while (e.hasMoreElements()) {
            // counter variable
            }

            -------
            SS


            That's really not a good idea - traversing a queue with a browser to find out number of messages is going to be very slow.

            Why not just use the JMX management interface? See message counters in the user guide. It's all in the documentation!

            • 3. Re: monitoring msg updates via queues
              ssjboss

              thanks , i will also use this