I have developed set of tools to "browse" messages on destinations for Kabutar. The approach I've taken is to use JBoss JMS MBeans rather than clumsy JMS QueueBrowser.
I am able to create/fetch the MBean responsible for the destination of my interest, however, when I try to have a peek at the message content, I don't get anything except printing: JBossMessage[0]:NON-PERSISTENT JBossMessage[0]:NON-PERSISTENT etc.. I get null when I tried getting the text (after convesion to TextMessage) from the message. here's my test code: | public void testQueueInfo() throws Exception | { | String name = "testSecuredQueue"; | logger.info("Deploying the queue - " + name); | MBeanServerConnection mBeanServer = lookupMBeanServerProxy(new InitialContext()); | ObjectName serverObjectName = new ObjectName( | "jboss.messaging.destination:service=Queue,name=" + name); | ArrayList o = (ArrayList) mBeanServer.invoke(serverObjectName, | "listAllMessages", new Object[0], new String[0]); | for (Iterator i = o.iterator(); i.hasNext();) | { | Message msg = (Message)i.next(); | logger.info("Message: " + msg); | TextMessage txtMsg = (TextMessage)msg; | logger.info("TxtMessage: " + txtMsg.getText()); | } | } | The same happens when you access litAllMessages method via JMX Browser Any pointers? Thanks Madhu View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049358#4049358 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049358 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user