[jboss-user] [JBoss Messaging] - Re: Viewing message contents in a queue

parressh do-not-reply at jboss.com
Tue May 29 13:10:41 EDT 2007


Hi Tim.  I've written a QueueBrowser to look at the messages on the queue.  But it's not quite working if I have an MDB configured to listen on the queue.  Once I do that, I no longer see the messages on the queue.  It does show the messages when I remove the MDB.  On the JMX console, it shows the message counts properly whether I have the MDB or not, but the QueueBrowser only shows the messages without the MDB.

My feeling is that this is a bug, another issue of JBM + MDB's.  However, is there something differently that I need to be doing?  Here's more or less the code snippet I'm using:


  |         QueueConnection conn = null;
  |         QueueSession session = null;
  |         QueueBrowser browser = null;
  |             conn = qcf.createQueueConnection();
  |             session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
  |             List<String> leads = new ArrayList<String>();
  |             browser = session.createBrowser(leadQueue);
  |             Enumeration messages = browser.getEnumeration();
  |             while (messages.hasMoreElements()) {
  |                 TextMessage message = (TextMessage) messages.nextElement();
  |                 leads.add(message.getText());
  |             }
  | 

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

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



More information about the jboss-user mailing list