I have a good question, before perform following line:
One way to know if messages are waiting in a queue (blocked messages for example), and a way to force
the sending/receving of the last messages present ?
I use a MessageHandler and onMessage(), in previous method I'm forced to call clientSession.commit() and clientMessage.acknowledge() ?
What commit() and acknowledge() really do ? And what the "in order to use" previous method can be served/used ?
Are 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.
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.
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?