I have a route which read messages from an ActiveMQ queue and writes to
another queue.
When message load increases consumers count reaching maxConcurrentConsumers
value but when message load decreases or producer stopped then consumer
count not coming down to idleConsumerLimit value.
I am using Spring Jndi to connect ActiveMQ

Here is the Route
<route id="Test_Route">

    <from uri="jms:INPUT_QUEUE"/>
    <process ref="TestPrintProcessorBean"/>
    <to uri="jms:OUTPUT_QUEUE"/>
</route>

and Bean configuration
<bean...>
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">

    <property name="environment">
        <props>
            <prop
key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
            <prop key="java.naming.provider.url">tcp://localhost:61616</prop>
        </props>
    </property>
</bean>

<bean id="jmsConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jndiTemplate"/>
    <property name="jndiName" value="ConnectionFactory"/>
</bean>

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="concurrentConsumers" value="1"/>
    <property name="maxConcurrentConsumers" value="20"/>
    <property name="idleConsumerLimit" value="5"/>
</bean>

</beans>

Kindly advise on this.

Thanks.

Reply via email to