This will end up in 2x20 threads. The 20 threads from the JMS queue will call
the sync version of the ThreadProcessors process function. This functions
use AsyncProcessorHelpers to call the ASync version. This would work but it
is an ugly configuration.
By the API definition "A processor is used to implement the Event Driven
Consumer and Message Translater patterns and to process message exchanges."
I think a implementation of the Message Translater with a PollingConsumer
would be useful. We have very high load Message Translater (MyHardWork())
and we have a critical high load environment. So I really don't want to have
control over fetching from the JMS.
I think we need to implement a threaded environment like ThreadProcessor BUT
use the polling consumer. This would result in a code mixture/combination of
the BatchProcessor and ThreadProcessor. Let's call it PollingThreadProcessor
(I know it's not a real processor/it's not implementing the Processor
interface).
This class would have one thread polling while (isAllowed && threadQueue
size is OK).
What do you think? does this fit into EIP?
--Michael
James.Strachan wrote:
>
> On 07/04/2008, fuchsmi <[EMAIL PROTECTED]> wrote:
>>
>> Hi All,
>>
>> I want to read from an JMS queue and run multi threaded a processor on
>> it.
>>
>> So:
>> From("activemq:income").thread(20).process(new
>> MyHardWork()).to("activemq:outqueue");
>
> If you are using JMS it supports concurrent consumption already. Just do
>
> from("activemq:income?concurrentConsumers=20")...
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
--
View this message in context:
http://www.nabble.com/Async-JMS-consumer-tp16538660s22882p16564261.html
Sent from the Camel - Development mailing list archive at Nabble.com.