maxConcurrentConsumers and idling

2011-08-01 Thread Tommy Chheng
I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
concurrentConsumers=2maxConcurrentConsumers=20

Should the current # of concurrent consumers dynamically adjust due to
message volume from activemq?

At the start, when there are 0 messages, the # of consumers is 2.
When I have a large volume, the # of consumers goes up to 20, but after the
volume goes back to 0, the current # of consumers still remain at 20.

I'm checking the # of consumers using the activemq web console.

Any ideas how to make the # of consumers go back to 2 when there's no
volume?

-- 
@tommychheng
http://tommy.chheng.com


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Claus Ibsen
On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng tommy.chh...@gmail.com wrote:
 I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
 concurrentConsumers=2maxConcurrentConsumers=20

 Should the current # of concurrent consumers dynamically adjust due to
 message volume from activemq?

 At the start, when there are 0 messages, the # of consumers is 2.
 When I have a large volume, the # of consumers goes up to 20, but after the
 volume goes back to 0, the current # of consumers still remain at 20.


The threads should have a idel time, that after X period should cause
them to terminate.
Check the spring documentation as its the spring-jms message listener
container, that is used
when consuming messages.


 I'm checking the # of consumers using the activemq web console.

 Any ideas how to make the # of consumers go back to 2 when there's no
 volume?

 --
 @tommychheng
 http://tommy.chheng.com




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Tommy Chheng
Looking at
http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html,
it looks like the setting i need is idleConsumerLimit

idleConsumerLimit property specifies the limit on the number of idle
consumers
I think this means that after the message volume decreases, the consumers
will become idle and thus be limited to this parameter.

Unfortunately, I get a Unknown parameters=[{idleConsumerLimit=10}] when i
use it in the activemq connection for camel.

I notice this is parameter is not listed in http://camel.apache.org/jms.html

Is this the right parameter or is there a workaround?


On Mon, Aug 1, 2011 at 8:56 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng tommy.chh...@gmail.com
 wrote:
  I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
  concurrentConsumers=2maxConcurrentConsumers=20
 
  Should the current # of concurrent consumers dynamically adjust due to
  message volume from activemq?
 
  At the start, when there are 0 messages, the # of consumers is 2.
  When I have a large volume, the # of consumers goes up to 20, but after
 the
  volume goes back to 0, the current # of consumers still remain at 20.
 

 The threads should have a idel time, that after X period should cause
 them to terminate.
 Check the spring documentation as its the spring-jms message listener
 container, that is used
 when consuming messages.


  I'm checking the # of consumers using the activemq web console.
 
  Any ideas how to make the # of consumers go back to 2 when there's no
  volume?
 
  --
  @tommychheng
  http://tommy.chheng.com
 



 --
 Claus Ibsen
 -
 FuseSource
 Email: cib...@fusesource.com
 Web: http://fusesource.com
 Twitter: davsclaus, fusenews
 Blog: http://davsclaus.blogspot.com/
 Author of Camel in Action: http://www.manning.com/ibsen/




-- 
@tommychheng
http://tommy.chheng.com


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Jon Anstey
That looks like a new property in Spring 3... we should add that option to
camel-jms but for now you should be able to make your own custom
JmsConfiguration class (extending the Camel JmsConfiguration one) and
override configureMessageListenerContainer to set up your idleConsumerLimit
value. You can use a custom JmsConfiguration like this:

bean id=jmsConfig class=com.foo.MyJmsConfiguration
property name=connectionFactory ref=jmsConnectionFactory/
property name=idleConsumerLimit value=10/
property name=concurrentConsumers value=2/
property name=maxConcurrentConsumers value=20/
/bean

bean id=activemq
class=org.apache.activemq.camel.component.ActiveMQComponent
property name=configuration ref=jmsConfig/
/bean

Cheers,
Jon

On Mon, Aug 1, 2011 at 2:22 PM, Tommy Chheng tommy.chh...@gmail.com wrote:

 Looking at

 http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html
 ,
 it looks like the setting i need is idleConsumerLimit

 idleConsumerLimit property specifies the limit on the number of idle
 consumers
 I think this means that after the message volume decreases, the consumers
 will become idle and thus be limited to this parameter.

 Unfortunately, I get a Unknown parameters=[{idleConsumerLimit=10}] when i
 use it in the activemq connection for camel.

 I notice this is parameter is not listed in
 http://camel.apache.org/jms.html

 Is this the right parameter or is there a workaround?


 On Mon, Aug 1, 2011 at 8:56 AM, Claus Ibsen claus.ib...@gmail.com wrote:

  On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng tommy.chh...@gmail.com
  wrote:
   I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
   concurrentConsumers=2maxConcurrentConsumers=20
  
   Should the current # of concurrent consumers dynamically adjust due to
   message volume from activemq?
  
   At the start, when there are 0 messages, the # of consumers is 2.
   When I have a large volume, the # of consumers goes up to 20, but after
  the
   volume goes back to 0, the current # of consumers still remain at 20.
  
 
  The threads should have a idel time, that after X period should cause
  them to terminate.
  Check the spring documentation as its the spring-jms message listener
  container, that is used
  when consuming messages.
 
 
   I'm checking the # of consumers using the activemq web console.
  
   Any ideas how to make the # of consumers go back to 2 when there's no
   volume?
  
   --
   @tommychheng
   http://tommy.chheng.com
  
 
 
 
  --
  Claus Ibsen
  -
  FuseSource
  Email: cib...@fusesource.com
  Web: http://fusesource.com
  Twitter: davsclaus, fusenews
  Blog: http://davsclaus.blogspot.com/
  Author of Camel in Action: http://www.manning.com/ibsen/
 



 --
 @tommychheng
 http://tommy.chheng.com




-- 
Cheers,
Jon
---
FuseSource
Email: j...@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Claus Ibsen
Hi Tommy

Fell free to create a JIRA ticket as I there may be new/missing
options from DMLC that we have not exposed in camel-jms yet.
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html



On Mon, Aug 1, 2011 at 6:52 PM, Tommy Chheng tommy.chh...@gmail.com wrote:
 Looking at
 http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html,
 it looks like the setting i need is idleConsumerLimit

 idleConsumerLimit property specifies the limit on the number of idle
 consumers
 I think this means that after the message volume decreases, the consumers
 will become idle and thus be limited to this parameter.

 Unfortunately, I get a Unknown parameters=[{idleConsumerLimit=10}] when i
 use it in the activemq connection for camel.

 I notice this is parameter is not listed in http://camel.apache.org/jms.html

 Is this the right parameter or is there a workaround?


 On Mon, Aug 1, 2011 at 8:56 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng tommy.chh...@gmail.com
 wrote:
  I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
  concurrentConsumers=2maxConcurrentConsumers=20
 
  Should the current # of concurrent consumers dynamically adjust due to
  message volume from activemq?
 
  At the start, when there are 0 messages, the # of consumers is 2.
  When I have a large volume, the # of consumers goes up to 20, but after
 the
  volume goes back to 0, the current # of consumers still remain at 20.
 

 The threads should have a idel time, that after X period should cause
 them to terminate.
 Check the spring documentation as its the spring-jms message listener
 container, that is used
 when consuming messages.


  I'm checking the # of consumers using the activemq web console.
 
  Any ideas how to make the # of consumers go back to 2 when there's no
  volume?
 
  --
  @tommychheng
  http://tommy.chheng.com
 



 --
 Claus Ibsen
 -
 FuseSource
 Email: cib...@fusesource.com
 Web: http://fusesource.com
 Twitter: davsclaus, fusenews
 Blog: http://davsclaus.blogspot.com/
 Author of Camel in Action: http://www.manning.com/ibsen/




 --
 @tommychheng
 http://tommy.chheng.com




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Jon Anstey
FYI idleConsumerLimit will be configurable in the next release of Camel
(2.9) see https://issues.apache.org/jira/browse/CAMEL-4290

On Mon, Aug 1, 2011 at 2:41 PM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi Tommy

 Fell free to create a JIRA ticket as I there may be new/missing
 options from DMLC that we have not exposed in camel-jms yet.

 http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html



 On Mon, Aug 1, 2011 at 6:52 PM, Tommy Chheng tommy.chh...@gmail.com
 wrote:
  Looking at
 
 http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html
 ,
  it looks like the setting i need is idleConsumerLimit
 
  idleConsumerLimit property specifies the limit on the number of idle
  consumers
  I think this means that after the message volume decreases, the consumers
  will become idle and thus be limited to this parameter.
 
  Unfortunately, I get a Unknown parameters=[{idleConsumerLimit=10}] when i
  use it in the activemq connection for camel.
 
  I notice this is parameter is not listed in
 http://camel.apache.org/jms.html
 
  Is this the right parameter or is there a workaround?
 
 
  On Mon, Aug 1, 2011 at 8:56 AM, Claus Ibsen claus.ib...@gmail.com
 wrote:
 
  On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng tommy.chh...@gmail.com
  wrote:
   I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
   concurrentConsumers=2maxConcurrentConsumers=20
  
   Should the current # of concurrent consumers dynamically adjust due to
   message volume from activemq?
  
   At the start, when there are 0 messages, the # of consumers is 2.
   When I have a large volume, the # of consumers goes up to 20, but
 after
  the
   volume goes back to 0, the current # of consumers still remain at 20.
  
 
  The threads should have a idel time, that after X period should cause
  them to terminate.
  Check the spring documentation as its the spring-jms message listener
  container, that is used
  when consuming messages.
 
 
   I'm checking the # of consumers using the activemq web console.
  
   Any ideas how to make the # of consumers go back to 2 when there's no
   volume?
  
   --
   @tommychheng
   http://tommy.chheng.com
  
 
 
 
  --
  Claus Ibsen
  -
  FuseSource
  Email: cib...@fusesource.com
  Web: http://fusesource.com
  Twitter: davsclaus, fusenews
  Blog: http://davsclaus.blogspot.com/
  Author of Camel in Action: http://www.manning.com/ibsen/
 
 
 
 
  --
  @tommychheng
  http://tommy.chheng.com
 



 --
 Claus Ibsen
 -
 FuseSource
 Email: cib...@fusesource.com
 Web: http://fusesource.com
 Twitter: davsclaus, fusenews
 Blog: http://davsclaus.blogspot.com/
 Author of Camel in Action: http://www.manning.com/ibsen/




-- 
Cheers,
Jon
---
FuseSource
Email: j...@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Tommy Chheng
Thanks Jon,
Upon reading the Spring documentation link, I'm a little confused about
dynamic scaling of consumers.

*There is another parameter IdleTaskExecutionLimit which states it
should close idle resources:*

The default is 1, closing idle resources early once a task didn't receive a
message. This applies to dynamic scheduling only; see the
maxConcurrentConsumershttp://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html#setMaxConcurrentConsumers(int)
setting.
The minimum number of consumers (see
concurrentConsumershttp://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html#setConcurrentConsumers(int))
will be kept around until shutdown in any case.


This one is currently supported in camel-jms but even with
concurrentConsumers=2maxConcurrentConsumers=20IdleTaskExecutionLimit=1,
the consumer count stays at 20 after idling  5 minutes.


On Mon, Aug 1, 2011 at 10:40 AM, Jon Anstey jans...@gmail.com wrote:

 FYI idleConsumerLimit will be configurable in the next release of Camel
 (2.9) see https://issues.apache.org/jira/browse/CAMEL-4290

 On Mon, Aug 1, 2011 at 2:41 PM, Claus Ibsen claus.ib...@gmail.com wrote:

  Hi Tommy
 
  Fell free to create a JIRA ticket as I there may be new/missing
  options from DMLC that we have not exposed in camel-jms yet.
 
 
 http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html
 
 
 
  On Mon, Aug 1, 2011 at 6:52 PM, Tommy Chheng tommy.chh...@gmail.com
  wrote:
   Looking at
  
 
 http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html
  ,
   it looks like the setting i need is idleConsumerLimit
  
   idleConsumerLimit property specifies the limit on the number of idle
   consumers
   I think this means that after the message volume decreases, the
 consumers
   will become idle and thus be limited to this parameter.
  
   Unfortunately, I get a Unknown parameters=[{idleConsumerLimit=10}] when
 i
   use it in the activemq connection for camel.
  
   I notice this is parameter is not listed in
  http://camel.apache.org/jms.html
  
   Is this the right parameter or is there a workaround?
  
  
   On Mon, Aug 1, 2011 at 8:56 AM, Claus Ibsen claus.ib...@gmail.com
  wrote:
  
   On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng tommy.chh...@gmail.com
   wrote:
I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
concurrentConsumers=2maxConcurrentConsumers=20
   
Should the current # of concurrent consumers dynamically adjust due
 to
message volume from activemq?
   
At the start, when there are 0 messages, the # of consumers is 2.
When I have a large volume, the # of consumers goes up to 20, but
  after
   the
volume goes back to 0, the current # of consumers still remain at
 20.
   
  
   The threads should have a idel time, that after X period should cause
   them to terminate.
   Check the spring documentation as its the spring-jms message listener
   container, that is used
   when consuming messages.
  
  
I'm checking the # of consumers using the activemq web console.
   
Any ideas how to make the # of consumers go back to 2 when there's
 no
volume?
   
--
@tommychheng
http://tommy.chheng.com
   
  
  
  
   --
   Claus Ibsen
   -
   FuseSource
   Email: cib...@fusesource.com
   Web: http://fusesource.com
   Twitter: davsclaus, fusenews
   Blog: http://davsclaus.blogspot.com/
   Author of Camel in Action: http://www.manning.com/ibsen/
  
  
  
  
   --
   @tommychheng
   http://tommy.chheng.com
  
 
 
 
  --
  Claus Ibsen
  -
  FuseSource
  Email: cib...@fusesource.com
  Web: http://fusesource.com
  Twitter: davsclaus, fusenews
  Blog: http://davsclaus.blogspot.com/
  Author of Camel in Action: http://www.manning.com/ibsen/
 



 --
 Cheers,
 Jon
 ---
 FuseSource
 Email: j...@fusesource.com
 Web: fusesource.com
 Twitter: jon_anstey
 Blog: http://janstey.blogspot.com
 Author of Camel in Action: http://manning.com/ibsen




-- 
@tommychheng
http://tommy.chheng.com


Re: maxConcurrentConsumers and idling

2011-08-01 Thread Tommy Chheng
Ah, that's the parameter i needed.

Thanks Jon!

On Mon, Aug 1, 2011 at 11:16 AM, Jon Anstey jans...@gmail.com wrote:

 Maybe try setting maxMessagesPerTask to a positive value? Seems to imply
 that this is required here when the feature was introduced:
 https://jira.springsource.org/browse/SPR-2814 I haven't tried this for
 myself though :)

 On Mon, Aug 1, 2011 at 3:19 PM, Tommy Chheng tommy.chh...@gmail.com
 wrote:

  Thanks Jon,
  Upon reading the Spring documentation link, I'm a little confused about
  dynamic scaling of consumers.
 
  *There is another parameter IdleTaskExecutionLimit which states it
  should close idle resources:*
 
  The default is 1, closing idle resources early once a task didn't receive
 a
  message. This applies to dynamic scheduling only; see the
  maxConcurrentConsumers
 
 http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html#setMaxConcurrentConsumers(int)
  
  setting.
  The minimum number of consumers (see
  concurrentConsumers
 
 http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html#setConcurrentConsumers(int)
  )
  will be kept around until shutdown in any case.
 
 
  This one is currently supported in camel-jms but even with
  concurrentConsumers=2maxConcurrentConsumers=20IdleTaskExecutionLimit=1,
  the consumer count stays at 20 after idling  5 minutes.
 
 
  On Mon, Aug 1, 2011 at 10:40 AM, Jon Anstey jans...@gmail.com wrote:
 
   FYI idleConsumerLimit will be configurable in the next release of Camel
   (2.9) see https://issues.apache.org/jira/browse/CAMEL-4290
  
   On Mon, Aug 1, 2011 at 2:41 PM, Claus Ibsen claus.ib...@gmail.com
  wrote:
  
Hi Tommy
   
Fell free to create a JIRA ticket as I there may be new/missing
options from DMLC that we have not exposed in camel-jms yet.
   
   
  
 
 http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html
   
   
   
On Mon, Aug 1, 2011 at 6:52 PM, Tommy Chheng tommy.chh...@gmail.com
 
wrote:
 Looking at

   
  
 
 http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html
,
 it looks like the setting i need is idleConsumerLimit

 idleConsumerLimit property specifies the limit on the number of
 idle
 consumers
 I think this means that after the message volume decreases, the
   consumers
 will become idle and thus be limited to this parameter.

 Unfortunately, I get a Unknown parameters=[{idleConsumerLimit=10}]
  when
   i
 use it in the activemq connection for camel.

 I notice this is parameter is not listed in
http://camel.apache.org/jms.html

 Is this the right parameter or is there a workaround?


 On Mon, Aug 1, 2011 at 8:56 AM, Claus Ibsen claus.ib...@gmail.com
 
wrote:

 On Mon, Aug 1, 2011 at 5:12 PM, Tommy Chheng 
  tommy.chh...@gmail.com
 wrote:
  I'm using camel 2.7.2 and connecting to an ActiveMQ queue with
  concurrentConsumers=2maxConcurrentConsumers=20
 
  Should the current # of concurrent consumers dynamically adjust
  due
   to
  message volume from activemq?
 
  At the start, when there are 0 messages, the # of consumers is
 2.
  When I have a large volume, the # of consumers goes up to 20,
 but
after
 the
  volume goes back to 0, the current # of consumers still remain
 at
   20.
 

 The threads should have a idel time, that after X period should
  cause
 them to terminate.
 Check the spring documentation as its the spring-jms message
  listener
 container, that is used
 when consuming messages.


  I'm checking the # of consumers using the activemq web console.
 
  Any ideas how to make the # of consumers go back to 2 when
 there's
   no
  volume?
 
  --
  @tommychheng
  http://tommy.chheng.com
 



 --
 Claus Ibsen
 -
 FuseSource
 Email: cib...@fusesource.com
 Web: http://fusesource.com
 Twitter: davsclaus, fusenews
 Blog: http://davsclaus.blogspot.com/
 Author of Camel in Action: http://www.manning.com/ibsen/




 --
 @tommychheng
 http://tommy.chheng.com

   
   
   
--
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
   
  
  
  
   --
   Cheers,
   Jon
   ---
   FuseSource
   Email: j...@fusesource.com
   Web: fusesource.com
   Twitter: jon_anstey
   Blog: http://janstey.blogspot.com
   Author of Camel in Action: http://manning.com/ibsen
  
 
 
 
  --
  @tommychheng
  http://tommy.chheng.com
 



 --
 Cheers,
 Jon