From users-return-21211-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Wed Nov 04 22:14:57 2009 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 91728 invoked from network); 4 Nov 2009 22:12:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Nov 2009 22:12:34 -0000 Received: (qmail 92621 invoked by uid 500); 4 Nov 2009 20:23:11 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 92583 invoked by uid 500); 4 Nov 2009 20:23:11 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 92569 invoked by uid 99); 4 Nov 2009 20:23:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 20:23:11 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tabish121@gmail.com designates 209.85.216.178 as permitted sender) Received: from [209.85.216.178] (HELO mail-px0-f178.google.com) (209.85.216.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 20:23:09 +0000 Received: by pxi8 with SMTP id 8so5034002pxi.27 for ; Wed, 04 Nov 2009 12:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=m6mLPWV4i7x2XYuEG6tzmmUQdqPG4fEf73pxaoHdYyk=; b=hfRiNAVaqa4GHQM9dnW9/9c4Yiw4vKGl+AjBIJSp96miDxPeI3+WgRwRKQ9yCIMH4O KzfTqiNgWYenywEXRNwobAYgS5ga9zkNkJ5hrhC51hT+wRqfQnGJnmUAD5XTLejfjhlw szSua/BcdwzjW/scSlLiKxfWUtod+yqIZ8Orc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=IpR7IRTcCTdNSFcJ2jk2Kh12OVRES9837+U4/tOK2Pa5/KMHYyYU3uPUHVJ7WVg5hK 37WK30C9Z8nzFpq3/zD5KG0Ihyr0oeVT7ndK11AFIcpas+N/uIpeBZZz1hnAF+/GtePG u+6oz7Asi8XHS4S+ky5Vt0HHOjNNdUq/fqPs0= Received: by 10.115.117.13 with SMTP id u13mr2877984wam.150.1257366168945; Wed, 04 Nov 2009 12:22:48 -0800 (PST) Received: from ?192.168.2.150? (c-69-138-183-90.hsd1.va.comcast.net [69.138.183.90]) by mx.google.com with ESMTPS id 21sm796386pzk.7.2009.11.04.12.22.47 (version=SSLv3 cipher=RC4-MD5); Wed, 04 Nov 2009 12:22:48 -0800 (PST) Subject: Re: ActiveMq-Cpp soConnectTimeout not working From: Timothy Bish To: users@activemq.apache.org In-Reply-To: <26203654.post@talk.nabble.com> References: <26200045.post@talk.nabble.com> <1257364018.3621.62.camel@localhost> <26203654.post@talk.nabble.com> Content-Type: text/plain Date: Wed, 04 Nov 2009 15:22:45 -0500 Message-Id: <1257366165.3621.77.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit On Wed, 2009-11-04 at 12:00 -0800, bpmuser wrote: > > > Timothy Bish wrote: > > > > On Wed, 2009-11-04 at 08:50 -0800, bpmuser wrote: > > The failover transport is going to keep trying to reconnect here even if > > the soConnectTimeout causes the attempt to connect to fail. Have you > > tried without the failover transport in the mix to see if > > soConnectTimeout is working? > > > > tcp://127.0.0.1:61616?soConnectTimeout=1 > > > > If you are looking for a way to have the connection fail when using the > > Failover transport then you'd probably want to set the > > maxReconnectAttempts value on the Failover transport as follows. > > > > failover:(tcp://127.0.0.1:61616?soConnectTimeout=1)?maxReconnectAttempts=50 > > > > Regards > > Tim. > > > > > > Removing failover worked, but adding maxReconnectAttemps to the failover put > me into a lock again. Do you have an ExceptionListener registered on the Connection object? When the max reconnect attempts is exceeded this will get called with the error. Where exactly are things locking, and what is the behavior you are trying to get? > > I started using failover since my program was disconnecting after a minute > of inactivity. Is there a way to check the connection status and restore > lost connections without the failover? Or is there a way to stop the > disconnect after a minute of inactivity? Using failover is a good idea in most cases as it lets your client keep running when you restart brokers, or have other issues. The frequent disconnection is probably because you are using the newer 5.3 broker which changed some things with the inactivity monitor which causes the .Net and C++ client to do this. You can stop this in one of three ways. 1. add this option to your client's current URI string; wireFormat.MaxInactivityDuration=-1 2. Change the Openwire connector configuration in ActiveMQ's activemq.xml to the following: 3. Download the latest source for AMQCPP from trunk and use that, the problem has been addressed there and should stop the frequent disconnects. Regards Tim. > > Cheers, > Brian!