You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/06/28 07:51:45 UTC

[2/2] camel git commit: CAMEL-11470 - Camel-Core: DefaultShutdownStrategy, pass the logInflightExchangesOnTimeout to the ShutdownTask

CAMEL-11470 - Camel-Core: DefaultShutdownStrategy, pass the logInflightExchangesOnTimeout to the ShutdownTask


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/14a7cb88
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/14a7cb88
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/14a7cb88

Branch: refs/heads/master
Commit: 14a7cb8893d410a90e2679e9584cb269475efc1f
Parents: 61ad97f
Author: Andrea Cosentino <an...@gmail.com>
Authored: Wed Jun 28 09:24:33 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Jun 28 09:51:31 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/impl/DefaultShutdownStrategy.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/14a7cb88/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
index adc69ff..f06b52b 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
@@ -197,7 +197,7 @@ public class DefaultShutdownStrategy extends ServiceSupport implements ShutdownS
 
         // use another thread to perform the shutdowns so we can support timeout
         timeoutOccurred.set(false);
-        currentShutdownTaskFuture = getExecutorService().submit(new ShutdownTask(context, routesOrdered, timeout, timeUnit, suspendOnly, abortAfterTimeout, timeoutOccurred));
+        currentShutdownTaskFuture = getExecutorService().submit(new ShutdownTask(context, routesOrdered, timeout, timeUnit, suspendOnly, abortAfterTimeout, timeoutOccurred, isLogInflightExchangesOnTimeout()));
         try {
             currentShutdownTaskFuture.get(timeout, timeUnit);
         } catch (ExecutionException e) {
@@ -505,9 +505,10 @@ public class DefaultShutdownStrategy extends ServiceSupport implements ShutdownS
         private final long timeout;
         private final TimeUnit timeUnit;
         private final AtomicBoolean timeoutOccurred;
+        private final boolean logInflightExchangesOnTimeout;
 
         ShutdownTask(CamelContext context, List<RouteStartupOrder> routes, long timeout, TimeUnit timeUnit,
-                            boolean suspendOnly, boolean abortAfterTimeout, AtomicBoolean timeoutOccurred) {
+                            boolean suspendOnly, boolean abortAfterTimeout, AtomicBoolean timeoutOccurred, boolean logInflightExchangesOnTimeout) {
             this.context = context;
             this.routes = routes;
             this.suspendOnly = suspendOnly;
@@ -515,6 +516,7 @@ public class DefaultShutdownStrategy extends ServiceSupport implements ShutdownS
             this.timeout = timeout;
             this.timeUnit = timeUnit;
             this.timeoutOccurred = timeoutOccurred;
+            this.logInflightExchangesOnTimeout = logInflightExchangesOnTimeout;
         }
 
         public void run() {
@@ -628,7 +630,7 @@ public class DefaultShutdownStrategy extends ServiceSupport implements ShutdownS
                         LOG.info(msg);
 
                         // log verbose if DEBUG logging is enabled
-                        logInflightExchanges(context, routes, false);
+                        logInflightExchanges(context, routes, logInflightExchangesOnTimeout);
 
                         Thread.sleep(loopDelaySeconds * 1000);
                     } catch (InterruptedException e) {