Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think you're unlikely to get JMS to do what you want if you're running into a global transaction. If you use</p> <pre><code>@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) </code></pre> <p>this will force the application server to run in an unspecified transaction context. What this means is completely dependent on which application server you are using. If you are using Websphere Application Server, it means that the bean runs outside of a transaction and so operations like sending and receiving messages do what you'd expect them to. Other application servers may handle this differently - read the documentation. Regardless, doing that is probably a bad idea. You're working against the application server.</p> <p>The JMS spec defines a mechanism for batching up the delivery of messages. IBM Websphere MQ calls this read-ahead <a href="http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fjm41130_.htm" rel="nofollow">http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fjm41130_.htm</a> and it allows for multiple messages to be read off the queue at once and delivered to the application one after the other. Other JMS implementations probably support something similar.</p> <p>Ultimately though, if your application requires that messages always be processed in order, you're going to have to deal with the overhead of committing each message before processing the next. The commit overhead almost certainly is much greater than the overhead of delivering a message to an MDB. Trying to hack in something to read extra messages inside an MDB won't get you around that. If that is an issue for you, you should probably look to make changes to the application to be able to process messages out-of-order.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload