camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From saw <>
Subject Route stops consuming from jms queue after several stop/resume
Date Mon, 17 Jan 2011 21:33:48 GMT

We have a need for one of our routes to be active only within a certain time
To accomplish we are using quartz to fire events at the window boundaries
and then starting or stopping the route programmatically using
exchange.getContext().start/stopRoute. (for the purposes of this we have
also tried suspend/resume but the problem persists).

The route consumes messages from a jms queue. The problem is that after a
certain number of start/stops the route stops consuming messages from the
We have noticed that when this happens the number of consumers on the jms
queue rises from 1 to 2.
It is as if the route starts up twice after a certain number of start/stops,
but one of those instances is not really active and it doesn't consume any

The problem is that this happens very randomly and we can't tell why. I have
managed to reproduce the problem consistently by simply having the route
start/stop very frequently (every minute or so). It is random, but
eventually it does happen.

We are using camel 2.5 inside spring 3.0.5, and activeMQ 5.4.2 

This is our config:

    <amq:connectionFactory id="amqConnectionFactory"
brokerURL="${jmsBroker}" />
    <bean id="connectionFactory"
        <constructor-arg ref="amqConnectionFactory" />
        <property name="sessionCacheSize" value="50" />

    <!-- JmsTemplate Definition. This is used to access the jms queues
directly from spring -->
    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
       <constructor-arg ref="connectionFactory"/>
    <bean id="jmsConfig"
        <property name="connectionFactory" ref="connectionFactory"/>
        <property name="transacted" value="false"/>

    <bean id="jms"
        <property name="configuration" ref="jmsConfig"/>

    <camelContext id="camel" xmlns="">
        <!-- This route runs only at specific time windows and consumes from
jms -->
        <route id="messageSender" autoStartup="false" >
            <from uri="jms:messageQueue" />
            <process ref="mesageGenerator" />

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message