CAMEL-9196: Timeout must be a positive value when calling stop route with a timeout value.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cd730069 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cd730069 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cd730069 Branch: refs/heads/camel-2.15.x Commit: cd7300692da1d72fc3c5c841723f9acf49b62b34 Parents: cd26a65 Author: Claus Ibsen <[email protected]> Authored: Wed Oct 7 07:15:36 2015 +0200 Committer: Claus Ibsen <[email protected]> Committed: Wed Oct 7 07:41:28 2015 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/impl/DefaultShutdownStrategy.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cd730069/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 eed2235..da2d3f8 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 @@ -166,6 +166,11 @@ public class DefaultShutdownStrategy extends ServiceSupport implements ShutdownS protected boolean doShutdown(CamelContext context, List<RouteStartupOrder> routes, long timeout, TimeUnit timeUnit, boolean suspendOnly, boolean abortAfterTimeout, boolean forceShutdown) throws Exception { + // timeout must be a positive value + if (timeout <= 0) { + throw new IllegalArgumentException("Timeout must be a positive value"); + } + // just return if no routes to shutdown if (routes.isEmpty()) { return true;
