You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2010/07/28 03:38:52 UTC
svn commit: r979924 -
/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
Author: ningjiang
Date: Wed Jul 28 01:38:52 2010
New Revision: 979924
URL: http://svn.apache.org/viewvc?rev=979924&view=rev
Log:
CAMEL-3000 Show the time to timeout while waiting for graceful shutdown
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java?rev=979924&r1=979923&r2=979924&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java Wed Jul 28 01:38:52 2010
@@ -376,6 +376,8 @@ public class DefaultShutdownStrategy ext
// wait till there are no more pending and inflight messages
boolean done = false;
+ long loopDelaySeconds = 1;
+ long loopCount = 0;
while (!done) {
int size = 0;
for (RouteStartupOrder order : routes) {
@@ -396,8 +398,9 @@ public class DefaultShutdownStrategy ext
}
if (size > 0) {
try {
- LOG.info("Waiting as there are still " + size + " inflight and pending exchanges to complete before we can shutdown");
- Thread.sleep(1000);
+ LOG.info("Waiting as there are still " + size + " inflight and pending exchanges to complete, timeout in " +
+ (TimeUnit.SECONDS.convert(getTimeout(), getTimeUnit()) - (loopCount++ * loopDelaySeconds)) + " seconds.");
+ Thread.sleep(loopDelaySeconds * 1000);
} catch (InterruptedException e) {
LOG.warn("Interrupted while waiting during graceful shutdown, will force shutdown now.");
Thread.currentThread().interrupt();