How can I implement JMS MessageListener?
Posted
by newbie
on Stack Overflow
See other posts from Stack Overflow
or by newbie
Published on 2009-10-16T05:39:46Z
Indexed on
2010/06/18
16:43 UTC
Read the original article
Hit count: 312
I tried to implement MessageListener, but it dosen't work, but when I use MessageListner, it doesn't work. So what should I do that MessageListener starts working, I'm using jboss 4.02.
recv.receive(); // This works
recv.setMessageListener(new ExListener()); // This doesn't work
public static class ExListener
implements MessageListener
{
public void onMessage(Message msg)
{
TextMessage tm = (TextMessage) msg;
try {
System.out.println("onMessage, recv text="+tm.getText());
} catch(Throwable t) {
t.printStackTrace();
}
}
}
© Stack Overflow or respective owner