Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89027E0A2 for ; Tue, 19 Feb 2013 11:48:42 +0000 (UTC) Received: (qmail 59121 invoked by uid 500); 19 Feb 2013 11:48:42 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 58687 invoked by uid 500); 19 Feb 2013 11:48:38 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 58653 invoked by uid 99); 19 Feb 2013 11:48:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 11:48:37 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.210.182 as permitted sender) Received: from [209.85.210.182] (HELO mail-ia0-f182.google.com) (209.85.210.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 11:48:31 +0000 Received: by mail-ia0-f182.google.com with SMTP id w33so5960384iag.41 for ; Tue, 19 Feb 2013 03:48:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=+eRDCa4VrDJ+2DC8WgEreIEeSrgfZ5bNq+QfRgWBB6E=; b=dOk36YlzPwSFjv1edtW0Uuh0FGWA7IMVd2OT8UxR7c5TsbwQBLVe41jLBhybs8XAlD AkD0CSmZIdmixnGHwXM5AXhHxjw6ugEGyOG3hZWNYJrhtxGNnN0sJU99XDZ4ULmWDv2l BkmU6cdabzdxxLqtkSbZVrsmfWSdNFG1cTznDM0jU0op8fWU/rhrglx2JxCFahcDGdsd W5tV4rBQd0JdUng5Ty7sQ71tvQzNQMtRfHU/JI9eckKj41n89kwVvP0LFZd89pt0VrOS maU9f0Dn+UVhaw3YUuLrFVuHpPFo9+WJWSys6yNBlLK8ZMgNFNJFYNPDL6vYvKWYtng3 Ok9Q== X-Received: by 10.50.6.230 with SMTP id e6mr9111820iga.3.1361274490645; Tue, 19 Feb 2013 03:48:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.53.232 with HTTP; Tue, 19 Feb 2013 03:47:49 -0800 (PST) In-Reply-To: <1361270751950-5727781.post@n5.nabble.com> References: <1361270751950-5727781.post@n5.nabble.com> From: Claus Ibsen Date: Tue, 19 Feb 2013 12:47:49 +0100 Message-ID: Subject: Re: camel shutsdown route even when using failover To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Are you sure your app keep running. The start method on spring app context is non blocking. See these FAQs http://camel.apache.org/running-camel-standalone.html http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html On Tue, Feb 19, 2013 at 11:45 AM, Marco Crivellaro wrote: > 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 > ActiveMQ? > > my spring context is as following: > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd > http://camel.apache.org/schema/spring > http://camel.apache.org/schema/spring/camel-spring.xsd"> > > xmlns="http://camel.apache.org/schema/spring" autoStartup="false"> > com.crive > > > > > > > > > > > > > > > > > > > > > class="org.apache.activemq.camel.component.ActiveMQComponent"> > > > value="failover://(tcp://hostname:61616)?initialReconnectDelay=100"/> > > > > > > > > > > main method is as following: > > public static void main(String[] args) throws Exception { > > > ApplicationContext appContext = new > FileSystemXmlApplicationContext("camel-context.xml"); > final SpringCamelContext context = (SpringCamelContext) > appContext.getBean("hulkcontext"); > context.start(); > > Runtime rt = Runtime.getRuntime(); > rt.addShutdownHook(new Thread() { > public void run() { > LOG.info("Application is being shutdown."); > try { > context.stop(); > } 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: http://camel.465427.n5.nabble.com/camel-shutsdown-route-even-when-using-failover-tp5727781.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen