camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Crivellaro <>
Subject camel shutsdown route even when using failover
Date Tue, 19 Feb 2013 10:45:51 GMT
Hi All,
I am setting up a camel context with 2 routes consuming 2 ActiveMQ queues.
The connectionstring to the broker specifies failover protocol, however if
the broker for some reason goes offline the context shutsdown itself
automatically. Is there a way to keep the context trying to reconnect to

my spring context is as following:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

  <camelContext id="hulkcontext"
xmlns="" autoStartup="false">
   		<from uri=""/>
   		<to uri="bean:myDataProcessor"/>
   		<inOut uri="mock:dataresult" />   		
   		<from uri="jms:queue:crive.status"/>
   		<to uri="bean:myStatusProcessor"/>
   		<inOnly uri="mock:statusresult" />

  <bean id="myDataProcessor" class="com.crive.DataProcessor"/>
  <bean id="myStatusProcessor" class="com.crive.StatusProcessor"/>  

  <bean id="jms"
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL"

main method is as following:

	public static void main(String[] args) throws Exception {
		ApplicationContext appContext = new
		final SpringCamelContext context = (SpringCamelContext)
		Runtime rt = Runtime.getRuntime();
		rt.addShutdownHook(new Thread() {
			public void run() {"Application is being shutdown.");
				try {						
				} catch (Exception e) {
					LOG.error("Exception occured while stopping the service", e);

it looks like the shutdown hook is being called as in the Logs I can find
"Application is being shutdown." but I am not calling it programmatically

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

View raw message