camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shineOnYou <sanjeet.9...@gmail.com>
Subject Re: creating concurrent consumer on each queue
Date Tue, 18 Dec 2007 14:35:01 GMT

Hi James,
Thanks for reply.
Would you please explain the significance of Thread(int size) method in
ProcessorType Class.
Initially i thought the following code will create n consumer thread.
from(endpoint_1).Thread(n).process(new EventDrivenConsumer());

Well how to set multiple parameters i tried to use following that does not
seem to be working.
from("test-jms:queue:soo.loo?concurrentConsumers=5&explicitQosEnabled=true&priority=7").process(new
Processor(){           }
 
One more problem is that when i executed the application(stand-alone)
several time and then i started getting following exception and warning ---
WARNING: Failed to start jmx connector: Cannot bind to URL
[rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException:
jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]
Dec 18, 2007 8:02:01 PM
org.apache.activemq.store.DefaultPersistenceAdapterFactory createJournal
INFO: Journal is locked... waiting 10 seconds for the journal to be
unlocked.
Dec 18, 2007 8:02:11 PM
org.apache.activemq.store.DefaultPersistenceAdapterFactory createJournal
INFO: Journal is locked... waiting 10 seconds for the journal to be
unlocked.

thanks

James.Strachan wrote:
> 
> You could just specify the concurrent consumers in the URIs
> 
> from("activemq:queue:foo.bar?concurrentConsumers=7")....
> 
> For more see
> http://activemq.apache.org/camel/jms.html
> 
> On 18/12/2007, shineOnYou <sanjeet.9211@gmail.com> wrote:
>>
>> Hi everyone,
>>   can anyone please explain how to create concurrent
>> consumer(asynchronous)
>> for different queues.
>>
>> Following is my scenario :
>> camelContext.addRoutes(new RouteBuilder() {
>>         public void configure() {
>>         // set up a listener on the component
>>
>> from("activemq:queue:ada.q").choice().when(header("headerName").isEqualTo("widget")).to("activemq:queue:bda.q")
>>        
>> .when(header("headerName").isEqualTo("gadget")).to("activemq:queue:cda.q")
>>         .otherwise().to("activemq:queue:dda.q");
>>         from("activemq:queue:ada.q").process(new EventDrivenConsumer());
>>         from("activemq:queue:bda.q").process(new EventDrivenConsumer());
>>         from("activemq:queue:dda.q").process(new EventDrivenConsumer());
>>                 }
>>         });
>>
>> Above, i want to assign :
>> 9 consumer threads to queue "ada.q"
>> 7 consumer threads to queue "ada.q"
>> 5 consumer threads to queue "cda.q"
>> 3 consumer threads to queue "ddda.q"
>>
>> I tried to use JmsConfiguration class and set the no of concurrent
>> consumer
>> but these threads are being created only for first queue "ada.q" and for
>> remaining queue only one consumers are created.
>> Thanks
>> --
>> View this message in context:
>> http://www.nabble.com/creating-concurrent-consumer-on-each-queue-tp14396321s22882p14396321.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/creating-concurrent-consumer-on-each-queue-tp14396321s22882p14398031.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message