Re: Cannot synchronously receive a message when a MessageListener is set

2008-01-18 Thread James Strachan
On 18/01/2008, JS75 <[EMAIL PROTECTED]> wrote: > > Dear All: > I tried to receive message from topic, however, I got exception below. > [java] [java] javax.jms.IllegalStateException: Cannot > synchronously receive a message when a MessageListener is set > [java] [java] a

Re: Cannot synchronously receive a message when a MessageListener is set

2008-01-17 Thread Jonas Lim
Hi Jean, A MessageListener should only be set if you are using an asynchronous consumer, you will need to comment out "subscriber.setMessageListener(ml);" in your code if you're going to be using a synchronous consumer (ie. consumer.receive) which looks to be the case in your sample code. afa