-
1. Re: Check blocked messages before close session
clebert.suconic May 9, 2012 2:10 PM (in response to adryen31200)1 of 1 people found this helpfulAre you asking if there's a way to verify if the last message was receivied?
What about receiveNoWait()
About the second question: CoreAPI is a low level API. You always have to ACK, hence you have to call ACK and commit.
This was quite helpful for instance when we developed the resource-adapter. and it can be very helpful in a few cases like your message-handler. you get a finer control on the ack versus commit.
-
2. Re: Check blocked messages before close session
adryen31200 May 10, 2012 2:40 AM (in response to clebert.suconic)Thank for ACK Commit Reponse, and on what object I can call receiveNoWait() ? on ClientSession ? Because I'm using asynchronous reception with message handler, it's in order to verify if all messages were consume/receive in the queue/clientconsumer which will be closed ? If a message isn't block/stuck on the queue.
-
3. Re: Check blocked messages before close session
adryen31200 May 10, 2012 2:46 AM (in response to adryen31200)receiveNoWait() is just present in JMS API I think
-
4. Re: Check blocked messages before close session
ataylor May 10, 2012 2:48 AM (in response to adryen31200)Messages are buffered internally by the client so while there are messages at the server there will always be messages so waiting doesn't make sense. When you close a consumer it will wait for the last message to be delivered before returning any in the buffer and stopping the consumer.
what is it exactly you want to acheive?
-
5. Re: Check blocked messages before close session
adryen31200 May 10, 2012 6:51 AM (in response to ataylor)Ok for buffering on client but if one message isn't ack or isn't yet consumed by a message handler and I close client session what happen ?
-
6. Re: Check blocked messages before close session
ataylor May 10, 2012 7:38 AM (in response to adryen31200)The session close will wait for the onMessage to finish (with a timeout) so as long as you ack your mesage in the method you are fine.
-
7. Re: Check blocked messages before close session
adryen31200 May 10, 2012 8:38 AM (in response to ataylor)Ok thank it's clear now, my timeout throws because I was in debug with Eclipse :-)
-
8. Re: Check blocked messages before close session
clebert.suconic May 10, 2012 5:33 PM (in response to adryen31200)If you are closing too often though.. it would be optimal to turn off client buffering. Buffering is better though (if you can keep consuming / reusing it.. it would be better)