Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your description is a hard to follow, and I <em>don't</em> think it's a language issue. My best understanding is that your producer is blocking because the consumer takes a long time to process the message. If true, this implies that you're using durable messages and explicit acknowledgment after processing the message.</p> <p>And if that's the case, the two possible solutions are: (1) decide whether you really need the guarantees and use implicit acknowledgment and/or non-durable messages if not, or (2) reliably store the message in the consumer, acknowledge, and then process the message.</p> <hr> <p>Based on your edits, the short answer is "yes, you can spawn threads." Since the producer doesn't care whether the consumer is able to actually process the message, you have a lot of flexibility in how you handle it.</p> <p>I suspect that ActiveMQ has some property that would allow you to control the number of message-processing threads. I haven't used it extensively (prefer HornetQ), so can't give a definitive answer.</p> <p>However, even if it does, I'd prefer using a Java <code>ThreadPoolExecutorService</code> (I think that's the name of it; see <code>java.util.concurrent</code>). The main reason is that it provides its own internal work queue. No matter how many threads you give to the messaging framework, there's always the possibility that you'll have enough work to tie them up. With the <code>ExecutorService</code>, you will continue to receive and queue messages until you run out of memory (and if that happens, you have some design issues to resolve).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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