[jboss-user] [JBoss Messaging] - Re: monitoring msg updates via queues

timfox do-not-reply at jboss.com
Thu May 1 04:01:20 EDT 2008


"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!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148062#4148062

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148062



More information about the jboss-user mailing list