Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-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 E73D69E97 for ; Thu, 28 Jun 2012 12:59:01 +0000 (UTC) Received: (qmail 25745 invoked by uid 500); 28 Jun 2012 12:59:01 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 25422 invoked by uid 500); 28 Jun 2012 12:58:59 -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 25404 invoked by uid 99); 28 Jun 2012 12:58:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 12:58:58 +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 torsten@fusesource.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bk0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 12:58:51 +0000 Received: by bkty5 with SMTP id y5so1999422bkt.2 for ; Thu, 28 Jun 2012 05:58:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=DK9vtOoGG+KLqDKPfAPC35pCh0Ow0ExFVfMSDD1VsUQ=; b=DwZ8OLcG8mn1iEG97m3ky7fD1ws3tGqHM4kA/VwJjC2ULawkbeG779l31MC24ENdSa guHiempFhLksGBoXYBB7PHrVFLt0k/9+VPq1qCTVDQXzpt0IANUMfxnjh4UsDNNpHs+n 7SXCFGqFfc9BPGHc0Lj0BJ/6s364AOpbCARieMWsgev/8RAtvzAc1rBuyuoThWvK0132 zBWAG/giqp4puWS8CKeeiapugDYkVp9y07MnFJ0C6t2CyY0QVSnh8WojyLfxOtDYLV3t gA3LqQclj4zuVK5C0jQ+tz+VWdVA2GK79qtJRbFToIf1wflgEVEtvXQgctpoxAccbPqE Mz0g== Received: by 10.204.157.23 with SMTP id z23mr1095505bkw.71.1340888310698; Thu, 28 Jun 2012 05:58:30 -0700 (PDT) Received: from [192.168.178.31] (p57BD6657.dip0.t-ipconnect.de. [87.189.102.87]) by mx.google.com with ESMTPS id x23sm58910294bkw.12.2012.06.28.05.58.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jun 2012 05:58:30 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: master/slave, consumer can not failover From: Torsten Mielke In-Reply-To: <1340884772317-4653639.post@n4.nabble.com> Date: Thu, 28 Jun 2012 14:58:29 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3AED63DF-5722-4A02-95EC-0055F91E81A2@fusesource.com> References: <1340884772317-4653639.post@n4.nabble.com> To: users@activemq.apache.org X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQnT1/Yw7CA4WdnBacqTUPzcF3h8+uhdf2weZCJ0EenPEcp6wCFXLhNx1gn4HUtw3BLtTxdg What's the consumer's logging output?=20 When you shut down the master on hostA, the consumer will loose its = connection to the broker and should try to reconnect. It will try both = of the tcp urls in your list until it reconnects. Also, can you confirm that your slave broker starts up just fine on the = port number that you specified in your failover url of the consumer? Regards, Torsten Mielke torsten@fusesource.com tmielke@blogspot.com On Jun 28, 2012, at 1:59 PM, bizcenter wrote: > *Deploy the brokers with master/slave, when master stops, consumer can = not > reconnect to slave.* >=20 > code example: > /String brokerUrl =3D "failover:(tcp://hostA, tcp://hostB)"; > try { > connection =3D factory.createConnection(); > // if a durable topic subscription, and client id must be = unique > if (durable && null !=3D clientId && clientId.length() > 0) = { > connection.setClientID(clientId); > } > connection.setExceptionListener(this); > connection.start(); >=20 > session =3D connection.createSession(transacted, ackMode); > if (isTopic) { > destination =3D session.createTopic(subject); > } else { > destination =3D session.createQueue(subject); > } >=20 > if (isTopic && durable) { > if (null !=3D this.filter) { > consumer =3D = session.createDurableSubscriber((Topic) > destination, consumerName, this.filter, false); > } else { > consumer =3D = session.createDurableSubscriber((Topic) > destination, consumerName); > } > } else { > if (null !=3D this.filter) { > consumer =3D session.createConsumer(destination, > this.filter); > } else { > consumer =3D session.createConsumer(destination); > } > } >=20 > if (this.receiveTimeout =3D=3D 0) { > consumer.setMessageListener(this); > } else { > consumeMessagesAndClose(connection, session, consumer, > receiveTimeout); > } > // no execution about closing connection, session, consumer/ > = --------------------------------------------------------------------------= ---------------- >=20 > anyone can give me a favor? thanks. (my english is poor...) >=20 >=20 >=20 > -- > View this message in context: = http://activemq.2283324.n4.nabble.com/master-slave-consumer-can-not-failov= er-tp4653639.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com.