You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/07/31 13:07:03 UTC

[2/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.

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/6d2f8e19
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6d2f8e19
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6d2f8e19

Branch: refs/heads/camel-2.15.x
Commit: 6d2f8e19c53c516b0271cbdc94fa9ad4a993d98e
Parents: a0dac50
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jul 31 13:14:02 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jul 31 13:14:20 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/6d2f8e19/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;