camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] git commit: CAMEL-7668: When stopping Camel, then shutdown pojo @Consume eager.
Date Mon, 01 Sep 2014 07:50:12 GMT
CAMEL-7668: When stopping Camel, then shutdown pojo @Consume eager.


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

Branch: refs/heads/master
Commit: 509f4ea5dbc5749dd4ea939179bbcd952a59e3c8
Parents: 9a92064
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Sep 1 09:46:28 2014 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Sep 1 09:50:00 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/impl/DefaultCamelContext.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/509f4ea5/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 2c36dc5..f825a25 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -1971,6 +1971,14 @@ public class DefaultCamelContext extends ServiceSupport implements
ModelCamelCon
         // but clear any suspend routes
         suspendedRouteServices.clear();
 
+        // stop consumers from the services to close first, such as POJO consumer (eg @Consumer)
+        // which we need to stop after the routes, as a POJO consumer is essentially a route
also
+        for (Service service : servicesToClose) {
+            if (service instanceof Consumer) {
+                shutdownServices(service);
+            }
+        }
+
         // the stop order is important
 
         // shutdown default error handler thread pool


Mime
View raw message