Hi,

Just started using Messaging and I already have a bunch of test cases that I 
use with JBoss MQ and running into a problem with one of them. In a setup 
method for a JUnit test case I always clear the queues that I'm using so that I 
know I always start with the clean slate. Here is the code that I call for each 
queue:


  |     public static void clearQueue(QueueConnection connection, Queue queue) 
throws JMSException{
  |         long start = System.currentTimeMillis();
  |         QueueSession session = connection.createQueueSession(true, -1);
  |         QueueReceiver qr = session.createReceiver(queue);
  |         connection.start();
  |         while(qr.receiveNoWait()!= null){}
  |         session.commit();
  |         System.out.println("total time=" + (System.currentTimeMillis() - 
start));
  |     }
  | 

This code works fine in JBossMQ and clears the queue, but with JBoss Messaging 
the receiveNoWait call just returns null, even if there are messages in the 
queue! Any idea why?

As well, I checked to see if there are test cases that cover this topic, but 
couldn't find them in the distribution. Assuming that they are not in the 
distribution and I have just overlooked them, how can I easily access them? Do 
I have to check out from CVS or can they be included in the next release?

Appreciate any help with these two questions.

Regards,

Mark

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

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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to