Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 13904 invoked from network); 16 Feb 2010 16:26:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2010 16:26:14 -0000 Received: (qmail 67096 invoked by uid 500); 16 Feb 2010 16:26:14 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 67070 invoked by uid 500); 16 Feb 2010 16:26:14 -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 67060 invoked by uid 99); 16 Feb 2010 16:26:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Feb 2010 16:26:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jlebleu@gmail.com designates 74.125.78.144 as permitted sender) Received: from [74.125.78.144] (HELO ey-out-1920.google.com) (74.125.78.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Feb 2010 16:26:03 +0000 Received: by ey-out-1920.google.com with SMTP id 26so1356813eyw.0 for ; Tue, 16 Feb 2010 08:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iOIKG1eWtlbaGr+nghpamX6Kb6MYNFUYRZWgkMGugws=; b=Ffol70zAKKLzFfCPtAibV4PowkoL4d/1NiZlKsV/TcZNuQnCKCGZPgxeH2N2Gh2ZEN 25LzI9zg3uycLrtCbSo8D80aUEWb+BKmNx/iMNl79m8PGP+ql64TiN4bsF+R8MW9nY7x OswPLJAGoCaPSN3Wy2Tow7qjfKXrp7pEg9TQU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XpDtr1pcZuEnqtqSPkJHTz9Tid7gwES2pfl+UwgDCODDYb6c3zRUSNBICRzoomB1+l X/0VaoKpmIV9XzfvtbZqqC2iwCcAdWmYUVLy00smp+J6+AQzjCLL6FZGkjld1Gg1yGma ig7Y0Z331Sy+HUg1FdwxANkq996v3LRhu1qS8= MIME-Version: 1.0 Received: by 10.213.15.20 with SMTP id i20mr4068769eba.95.1266337543399; Tue, 16 Feb 2010 08:25:43 -0800 (PST) In-Reply-To: References: Date: Tue, 16 Feb 2010 17:25:43 +0100 Message-ID: Subject: Re: Consumer and Failover From: Jean-Yves LEBLEU To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org We are using 5.3.0, but have the same problem in 5.2.0 On Tue, Feb 16, 2010 at 5:20 PM, James Strachan wrote: > Which version are you using BTW? > > On 16 February 2010 16:17, Jean-Yves LEBLEU wrote: >> On Tue, Feb 16, 2010 at 4:54 PM, James Strachan >> wrote: >>> On 16 February 2010 15:38, Jean-Yves LEBLEU wrote: >>>> Hi all, >>>> >>>> I am trying to use the failover transport >>>> (failover:(tcp://localhost:61618)), and I have some questions : >>>> >>>> I did a test with a simple consumer in scala (see the code and log at >>>> the end of the mail). >>>> >>>> Scenario : >>>> Broker is stopped. >>>> We start the consumer, it waits >>>> Start the broker >>>> Consumer connects and consume messages >>>> Stop the broker and start the broker again >>>> Consumer tries 6 times to reconnect and stop working. >>> >>> I wonder if you have not restarted the broker in time for the client >>> to reconnect? How long does the client take to reconnect and how long >>> is the broker down for? >>> >>> Maybe you could try increasing the amount of time the failover >>> transport waits before failing to connect... >>> >>> http://activemq.apache.org/failover-transport-reference.html >>> >>> e.g. try this URL >>> >>> failover:(tcp://localhost:61618)?maxReconnectAttempts=3D1000 >>> >>> >>> BTW slightly more idiomatic Scala code for onMessage would be... >>> >>> def onMessage(message: Message): Unit =3D message match { >>> =A0case textMessage: TextMessage =3D> =A0println("Message recieved: " + >>> textMessage.getText()) >>> =A0case _ =3D> println("Oops, not a text message") >>> } >>> -- >>> James >>> ------- >>> http://macstrac.blogspot.com/ >>> >>> Open Source Integration >>> http://fusesource.com/ >>> >> >> James, >> >> Thanks for the more idiomatic Scala code, we are starting to use scala >> instead of java and have not explored all the scala subtelties :). >> >> I tried with maxReconnectAttempts=3D1000, the consumer stops after 7 >> attempts to reconnect to the broker. >> >> Regards. >> Jean-Yves >> > > > > -- > James > ------- > http://macstrac.blogspot.com/ > > Open Source Integration > http://fusesource.com/ >