camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] git commit: CAMEL-7668: When stopping Camel, then shutdown pojo @Consume eager.
Date Mon, 01 Sep 2014 07:50:11 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/a524500a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a524500a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a524500a

Branch: refs/heads/camel-2.12.x
Commit: a524500a1260548c3213d08a9be085f9523717f0
Parents: ad8354c
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:49:31 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/a524500a/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 0f2f3a9..2465b40 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
@@ -1781,6 +1781,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