Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D7FB8200BA7 for ; Fri, 21 Oct 2016 15:53:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D6A37160AE8; Fri, 21 Oct 2016 13:53:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2A203160AE0 for ; Fri, 21 Oct 2016 15:53:29 +0200 (CEST) Received: (qmail 87372 invoked by uid 500); 21 Oct 2016 13:53:28 -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 87360 invoked by uid 99); 21 Oct 2016 13:53:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2016 13:53:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8BC89C1B8F for ; Fri, 21 Oct 2016 13:53:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.32 X-Spam-Level: X-Spam-Status: No, score=-5.32 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VGUDeCP8D-7f for ; Fri, 21 Oct 2016 13:53:25 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id CEFED5F624 for ; Fri, 21 Oct 2016 13:53:24 +0000 (UTC) Received: from zmail09.collab.prod.int.phx2.redhat.com (zmail09.collab.prod.int.phx2.redhat.com [10.5.83.11]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9LDrEsP051491 for ; Fri, 21 Oct 2016 09:53:14 -0400 Date: Fri, 21 Oct 2016 09:53:14 -0400 (EDT) From: Justin Bertram To: users@activemq.apache.org Message-ID: <1910434144.5089025.1477057994236.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: Artemis automatic client reconnection? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.60.17] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - GC54 (Linux)/8.0.6_GA_5922) Thread-Topic: Artemis automatic client reconnection? Thread-Index: 73nIUZsLHZet0fyzXm8bgTz5sOl5FA== archived-at: Fri, 21 Oct 2016 13:53:30 -0000 I believe you should just need to specify a non-zero value for reconnectAttempts, e.g.: ActiveMQClient.createServerLocator("tcp://myhost:61616?reconnectAttempts=10"); Or you can invoke setReconnectAttempts() on the ServerLocator object before you use it. There's a couple of other parameters you can configure to control reconnection (e.g. retryInterval, retryIntervalMultiplier). You can also check out the "reattach-node" example shipped with Artemis to see a working example. Justin ----- Original Message ----- From: "Marko Asplund" To: "users" Sent: Friday, October 21, 2016 8:36:48 AM Subject: Artemis automatic client reconnection? Hi, How do I get an Artemis client session to automatically reconnect after a transient network disconnect or a server restart? Messages are consumed using the Artemis Core API message handler, so consumer processes are long-running and only create an Artemis client session at startup. Currently, the consumer doesn't seem to receive new messages after the server is restarted. Client connections are initiated using ActiveMQClient.createServerLocatorWithoutHA() (one server instance only). I'm using Artemis v1.4.0. Marko