Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B3009180EC for ; Fri, 31 Jul 2015 11:07:02 +0000 (UTC) Received: (qmail 34242 invoked by uid 500); 31 Jul 2015 11:07:02 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 34185 invoked by uid 500); 31 Jul 2015 11:07:02 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 34170 invoked by uid 99); 31 Jul 2015 11:07:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 11:07:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7B8C4DFBC9; Fri, 31 Jul 2015 11:07:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Fri, 31 Jul 2015 11:07:02 -0000 Message-Id: <7e4f0cbbd4e54cd0a4f8a030e390b1f1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] camel git commit: CAMEL-9035: camel-smpp should only clear session if was success to close. Otherwise it cannot try again on next attempt to close it. Thanks to Imram for the patch. Repository: camel Updated Branches: refs/heads/camel-2.15.x a0dac50e7 -> 6d2f8e19c refs/heads/master 0d24370a7 -> 7c813bd3d CAMEL-9035: camel-smpp should only clear session if was success to close. Otherwise it cannot try again on next attempt to close it. Thanks to Imram for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7c813bd3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7c813bd3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7c813bd3 Branch: refs/heads/master Commit: 7c813bd3d51bfc94e7cf459f33ba8cb6a93116a8 Parents: 0d24370 Author: Claus Ibsen Authored: Fri Jul 31 13:14:02 2015 +0200 Committer: Claus Ibsen Committed: Fri Jul 31 13:14:02 2015 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/component/smpp/SmppConsumer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/7c813bd3/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java index 5f6e516..3052b9d 100644 --- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java +++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java @@ -129,10 +129,11 @@ public class SmppConsumer extends DefaultConsumer { try { Thread.sleep(1000); session.unbindAndClose(); + // clear session as we closed it successfully + session = null; } catch (Exception e) { - LOG.warn("Could not close session " + session); + LOG.warn("Cannot close session due " + e.getMessage()); } - session = null; } } @@ -147,6 +148,7 @@ public class SmppConsumer extends DefaultConsumer { try { Thread.sleep(initialReconnectDelay); } catch (InterruptedException e) { + // ignore } int attempt = 0;