Note that there are some explanatory texts on larger screens.

plurals
  1. POLong traitement in a onMessage() : How to handle ? I want this method to be called by a thread
    text
    copied!<p>I do some heavy traitement at reception of JMS message, with high risk of timeout. </p> <p>whole point of using JMS for me is to allow this kind of computation to be done asynchronisely. ( I dont want my other consumer to block if one of them block, i dont want my producer to block, ever ). <strong>ideally, i also want my consumer to be able to receive second message during computation of first one</strong></p> <p>Right now, i'm using unique <a href="http://download.oracle.com/javaee/5/api/javax/jms/Session.html%20javax.jms.Session" rel="nofollow">javax.jms.Session</a> for sending, and consuming my message. I'm aware it was conception mistake. As doc state : </p> <blockquote> <p>session can create and service multiple message producers and consumers.</p> </blockquote> <p>But also :</p> <blockquote> <p>If client desires to have one thread produce messages while others consume them, client should use separate session for its producing thread.</p> </blockquote> <p>solution could be to use session for producer, and different session for each consumer, but consumers will still be able to handle only one message at time</p> <p><strong>For my understanding onMessage method is called by Jms Provider ( ActiveMq in my case ). Could any configuration allow this call to be call in several thread ?</strong></p> <p>Maybe this question is reflect of major flaw in my understanding of how JMS should be use / my conception. Please fell free to discuss ;)</p> <p>Thanks !</p> <p>Edit : </p> <p>my problem in one sentence : </p> <ul> <li>if i have 2 consumer, and if one of them take long time to process onMessge, all other consumer will blocK. </li> </ul> <p><strong>What is done today :</strong> I'm using a <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Executor.html" rel="nofollow">java.util.concurent.Executor</a>, but i'm not a big fan of this solution. I'm in a Tomcat application server context, and already using too much thread, i will like to delegate this responsability to a more robust bunch of code. ( Eg : activeMq )</p> <p>Edit 2 : </p> <p>More detail : </p> <ul> <li><p>I dont use transactional session </p></li> <li><p>I use Auto_Acknoledge</p></li> </ul>
 

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