java - JMS: Can we get multiple messages from queue in OnMessage() withtout commit or rollback -


i using jms client receives jms messages remote server. listening jms message in onmessage() method of client.

the issue facing that, messages getting accumulated on server side while consuming messages on client side @ regular interval.

i send rollback() or commit() depending upon processing doing on client's end.

i have query while processing jms message , have not sent commit() queue, can message server.

please note processing, doing wait processing of message received in synchronized block. new message while still processing , have not sent commit queue?

messagelistener#onmessage() executed part of session thread, not receive next message until return onmessage().

in general, should not process messages in onmessage(), if expected take more time. enqueue message separate data structure , have other thread process it.

you not have call commit() after every message, can continue receive message.

no. of message received without calling commit/rollback depends on client buffer size - configurable @ queue/global.

please note processing, doing wait processing of message received in synchronized block. new message while still processing , have not sent commit queue?

if processing in onmessage() not receive new message, no need have synchronized block inside onmessage().


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -