You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by selezovikj <se...@gmail.com> on 2008/10/22 17:55:43 UTC

Bean properties: concurrentConsumers problem

<route>
			<from uri="jms:topic:LoggingTopic"/>
			<to uri="bean:msgParser?concurrentConsumers=5"/>
</route>

Camel is complaining about the msgParser bean, saying that the
concurrentConsumers propety is not defined. 
I was wondering what is the correct way to set the number of
concurrentConsumers and maxConcurrentConsumers for a bean ?

When I use the @Service annotation of org.springframework.stereotype.Service
package to denote a bean inside Java, it cannot set concurrentConsumers. The
only thing it provides is the value of the bean. 


-- 
View this message in context: http://www.nabble.com/Bean-properties%3A-concurrentConsumers-problem-tp20113967s22882p20113967.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bean properties: concurrentConsumers problem

Posted by selezovikj <se...@gmail.com>.
<route>
			<from uri="jms:topic:LoggingTopic?maxConcurrentConsumers=5"/>
			<to uri="bean:msgParser"/>
			<to uri="bean:log4jBean"/>
</route>

I am getting a weird behavior. When I send three messages to the logging
topic having the maxConcurrentConsumers set to 5, the first message is
logged once, the second message is processed twice, the third message three
times. 
All subsequent messages are sent multiple times at the exact time and
processed multiple times. 

RequestA
ResponseA

RequestB
RequestB
ResponseB
ReponseB

RequestC
RequestC
RequestC
ResponseC
ResponseC
ResponseC







James.Strachan wrote:
> 
> 2008/10/22 selezovikj <se...@gmail.com>:
>>
>> <route>
>>                        <from uri="jms:topic:LoggingTopic"/>
>>                        <to uri="bean:msgParser?concurrentConsumers=5"/>
>> </route>
>>
>> Camel is complaining about the msgParser bean, saying that the
>> concurrentConsumers propety is not defined.
> 
> the concurrentConsumers property is defined on the JMS endpoint BTW
> 
> 
>> I was wondering what is the correct way to set the number of
>> concurrentConsumers and maxConcurrentConsumers for a bean ?
> 
> Its the consuming (from) endpoint which defines concurrency.
> 
> 
>> When I use the @Service annotation of
>> org.springframework.stereotype.Service
>> package to denote a bean inside Java, it cannot set concurrentConsumers.
>> The
>> only thing it provides is the value of the bean.
> 
> You can set it on the @MessageDriven annotation URI
> http://activemq.apache.org/camel/pojo-consuming.html
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Bean-properties%3A-concurrentConsumers-problem-tp20113967s22882p20127586.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bean properties: concurrentConsumers problem

Posted by James Strachan <ja...@gmail.com>.
2008/10/22 selezovikj <se...@gmail.com>:
>
> <route>
>                        <from uri="jms:topic:LoggingTopic"/>
>                        <to uri="bean:msgParser?concurrentConsumers=5"/>
> </route>
>
> Camel is complaining about the msgParser bean, saying that the
> concurrentConsumers propety is not defined.

the concurrentConsumers property is defined on the JMS endpoint BTW


> I was wondering what is the correct way to set the number of
> concurrentConsumers and maxConcurrentConsumers for a bean ?

Its the consuming (from) endpoint which defines concurrency.


> When I use the @Service annotation of org.springframework.stereotype.Service
> package to denote a bean inside Java, it cannot set concurrentConsumers. The
> only thing it provides is the value of the bean.

You can set it on the @MessageDriven annotation URI
http://activemq.apache.org/camel/pojo-consuming.html
-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

RE: Bean properties: concurrentConsumers problem

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

You should set the concurrent consumer on the JMS consumer instead. Then you have 5 consumers at once:

<route>
			<from uri="jms:topic:LoggingTopic?concurrentConsumers=5"/>
			<to uri="bean:msgParser"/>
</route>



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: selezovikj [mailto:semir.elezovic@gmail.com] 
Sent: 22. oktober 2008 17:56
To: camel-user@activemq.apache.org
Subject: Bean properties: concurrentConsumers problem


<route>
			<from uri="jms:topic:LoggingTopic"/>
			<to uri="bean:msgParser?concurrentConsumers=5"/>
</route>

Camel is complaining about the msgParser bean, saying that the
concurrentConsumers propety is not defined. 
I was wondering what is the correct way to set the number of
concurrentConsumers and maxConcurrentConsumers for a bean ?

When I use the @Service annotation of org.springframework.stereotype.Service
package to denote a bean inside Java, it cannot set concurrentConsumers. The
only thing it provides is the value of the bean. 


-- 
View this message in context: http://www.nabble.com/Bean-properties%3A-concurrentConsumers-problem-tp20113967s22882p20113967.html
Sent from the Camel - Users mailing list archive at Nabble.com.