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 4A4E478A2 for ; Thu, 1 Dec 2011 09:09:00 +0000 (UTC) Received: (qmail 21984 invoked by uid 500); 1 Dec 2011 09:08:58 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 21277 invoked by uid 500); 1 Dec 2011 09:08: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 21256 invoked by uid 99); 1 Dec 2011 09:08:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 09:08:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jason.dillon@gmail.com designates 209.85.213.45 as permitted sender) Received: from [209.85.213.45] (HELO mail-yw0-f45.google.com) (209.85.213.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 09:08:29 +0000 Received: by ywe9 with SMTP id 9so1912992ywe.32 for ; Thu, 01 Dec 2011 01:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=hJq3aBN/FqYfbM4ycPwLjqNMDd+0gPbX76Tw9KqHhO8=; b=D2oUeZt+Jp0IivZrGrqvQieRVlEIP3FD8dVh0lGFcEENKlNwAdwgNmEk15cbXrMWXD +2JOO+ERXAy4X5Z2nlWHeCpcQqC9QS0fJejx5pWrR9ynop9tAshptkgvvAjZAjVZPjzc v+l2fqpz6y9R5FYJdHKVodGQkipbYhO+nXIQQ= Received: by 10.101.139.21 with SMTP id r21mr140308ann.87.1322730488526; Thu, 01 Dec 2011 01:08:08 -0800 (PST) Received: from [10.0.1.55] (c-98-248-96-179.hsd1.ca.comcast.net. [98.248.96.179]) by mx.google.com with ESMTPS id c10sm8596092yhj.2.2011.12.01.01.08.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Dec 2011 01:08:07 -0800 (PST) Sender: Jason Dillon Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1251.1) Subject: Re: Adding JMS route may block if remote is down using failover: connection From: Jason Dillon In-Reply-To: Date: Thu, 1 Dec 2011 01:08:04 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: users@camel.apache.org X-Mailer: Apple Mail (2.1251.1) This does not really help, as if you set the retry on startup and it = exceeds an exception is thrown and the route does not get added. I need to route to be added regardless if it can actually make a = connection at the time of adding or not. The connectivity to the jms = endpoint may or may not be available when the route is added, but either = way the route needs to get added, so that when the connectivity is = available that messages will flow. --jason On Nov 30, 2011, at 11:02 PM, Claus Ibsen wrote: > AMQ have a startup max reconnect attempt option you can use > http://activemq.apache.org/failover-transport-reference.html >=20 >=20 > On Thu, Dec 1, 2011 at 12:01 AM, Jason Dillon = wrote: >> I'm running into a problem where CamelContext.addRoutes() is blocking = when adding a route that uses a jms endpoint that is configured with = AcitveMQ's failover transport and the remote server is down. >>=20 >> This specific jms endpoint is configured to use = SingleConnectionFactory and ConsumerType.Simple to reduce thread usage. = Looks like when the consumer is started, that it attempts to open up the = connection: >>=20 >> >> jvm 1 | java.lang.Thread.State: TIMED_WAITING (on object = monitor) >> jvm 1 | at java.lang.Object.wait(Native Method) >> jvm 1 | - waiting on <7cbecd168> (a java.lang.Object) >> jvm 1 | at = org.apache.activemq.transport.failover.FailoverTransport.oneway(FailoverTr= ansport.java:516) >> jvm 1 | - locked <7cbecd168> (a java.lang.Object) >> jvm 1 | at = org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40= ) >> jvm 1 | - locked <7cbecd1b8> (a java.lang.Object) >> jvm 1 | at = org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorr= elator.java:81) >> jvm 1 | at = org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelato= r.java:86) >> jvm 1 | at = org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.j= ava:1284) >> jvm 1 | at = org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQCo= nnection.java:1392) >> jvm 1 | - locked <7cbecd340> (a java.lang.Object) >> jvm 1 | at = org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.ja= va:309) >> jvm 1 | at = org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java= :196) >> jvm 1 | at = org.springframework.jms.listener.SimpleMessageListenerContainer.initialize= Consumers(SimpleMessageListenerContainer.java:249) >> jvm 1 | - locked <7cbecd3d0> (a java.lang.Object) >> jvm 1 | at = org.springframework.jms.listener.SimpleMessageListenerContainer.doInitiali= ze(SimpleMessageListenerContainer.java:188) >> jvm 1 | at = org.springframework.jms.listener.AbstractJmsListeningContainer.initialize(= AbstractJmsListeningContainer.java:193) >> jvm 1 | at = org.springframework.jms.listener.AbstractJmsListeningContainer.afterProper= tiesSet(AbstractJmsListeningContainer.java:157) >> jvm 1 | at = org.apache.camel.component.jms.JmsConsumer.doStart(JmsConsumer.java:114) >> ... >> >>=20 >> And failover does its job and loops forever trying to establish. = This block camel from starting up fully. Is this a bug or am I = misconfiguring something? Once server is up, it behaves itself and = returns as expected. >>=20 >> Any suggestions on how to work around this? I'd rather not make a = new thread simply to add the route (or add not-autostart) and thread the = call to start the route, but... I don't see any other way to cope with = this ATM. >>=20 >> --jason >=20 >=20 >=20 > --=20 > Claus Ibsen > ----------------- > FuseSource > Email: cibsen@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/