-
1. Re: Getting a list of all ClientConsumers (http://jira.jboss
sergeypk Jun 29, 2007 5:35 AM (in response to sergeypk)The issue got truncated, it's http://jira.jboss.com/jira/browse/JBMESSAGING-983
-
2. Re: Getting a list of all ClientConsumers (http://jira.jboss
timfox Jun 29, 2007 6:15 AM (in response to sergeypk)Yes that should work.
For this task, you want to consider adding a start() and stop() method on the ClientConsumer class.
First you need to tell the server consumer endpoint to stop and obtain the lastDeliveryID (like how is currently done in closing()).
Then wait for the delivery to arrive and wait for onMessages to execute, much as is currently done in close(). -
3. Re: Getting a list of all ClientConsumers (http://jira.jboss
sergeypk Jun 29, 2007 11:49 AM (in response to sergeypk)I have got it working locally but I will need to add some more tests to make sure it's implemented correctly. I had to collect all those lastDeliveryIDs into a map on the server side and send them back to the client in a ConnectionStopResponse packet that I created.
Do we really have to wait for the delivery lastDeliveryID to come in this case? Wouldn't it be possible for ClientConsumer to still accept messages as usual when stopped but not deliver them to receive() and onMessage()? Then Connection.stop() could tell the server side to stop, wait until every ClientConsumer finishes any onMessage calls it has already started and return afterwards? -
4. Re: Getting a list of all ClientConsumers (http://jira.jboss
timfox Jun 29, 2007 11:53 AM (in response to sergeypk)Yes you're right.
There's no need to wait for the deliveries to arrive, just need to wait for onmessages to complete and make sure no more messages are returned to receive or sent to onMessage until it is restarted.