"jurivrljicak" wrote : this way?
|
| QueueBrowser browser = s.createBrowser(queue);
| int depth= getDepth(browser);
|
| private int getDepth(QueueBrowser browser) throws JMSException {
| int i=0;
| for(Enumeration e = browser.getEnumeration(); e.hasMoreElements(); ){
| i++;
| e.nextElement();
| }
| return i;
| }
|
| javax.jms api
This would probably be horribly slow - I wouldn't recommend it.
Also browsers are not mandated to provide a static snapshot of the queue, so the result
won't necessarily exactly reflect the number of messages in the queue at any
particular time.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020573#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...