[jboss-user] [JBoss Messaging] - Re: JBM2 Beta4 with JBAS5.1 - setListener( null )

2009-08-19 Thread jmesnil
simon_temple wrote : Using the JMS API.  If I attempt to clear the currently 
registered listener on a QueueReceiver then I get an IllegalStateException when 
I try to receive on it:
  | 
  | javax.jms.IllegalStateException: Cannot call receive(...) - a 
MessageHandler is set
  |   | at 
org.jboss.messaging.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:161)
  |   | at 
org.jboss.messaging.jms.client.JBossMessageConsumer.getMessage(JBossMessageConsumer.java:213)
  |   | at 
org.jboss.messaging.jms.client.JBossMessageConsumer.receiveNoWait(JBossMessageConsumer.java:146)
  | 
  | I have a simple test case which looks this:
  | 
  | queueReceiver.setMessageListener( listener );
  |   | 
  |   | queueConnection.start(  );
  |   | thread.wait( 3 );
  |   | 
  |   | queueReceiver.setMessageListener( null );
  |   | queueReceiver.receiveNoWait(  );
  |   | 
  | 
  | How can I clear the message listener attribute from a QueueReceiver once 
it's been set? 

Thre is a bug in the JBossMessageConsumer which prevents to unset the message 
listener. We'll fix it.

Please not however that even with this bug fixed, your test case may not work.
From MessageConsumer.setMessageListener() javadoc:

anonymous wrote : 
  | The effect of calling MessageConsumer.setMessageListener while messages are 
being consumed by an existing listener or the consumer is being used to consume 
messages synchronously is undefined.
  | 

You should stop your queueConnection to prevent message consumption before 
unsetting the message listener to have a correct behavior.

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=4250322#4250322

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250322
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: JBM2 Beta4 with JBAS5.1 - setListener( null )

2009-08-19 Thread simon_temple
Thank you.

I will change my test case to stop the the queueConnection and restart it once 
the listener has been removed (nulled).


View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=4250323#4250323

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250323
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: JBM2 Beta4 with JBAS5.1 - setListener( null )

2009-08-19 Thread timfox
Fixed in trunk https://jira.jboss.org/jira/browse/JBMESSAGING-1716

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=4250324#4250324

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250324
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: JBM2 Beta4 with JBAS5.1 - setListener( null )

2009-08-19 Thread simon_temple
I have retested against BETA5 and can confirm that this issue has been fixed.

:-)

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=4250340#4250340

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4250340
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user