Repository: syncope Updated Branches: refs/heads/master 20aa1d77c -> aa90d8408
SYNCOPE-931 - Restart Camel Context after update Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/aa90d840 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/aa90d840 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/aa90d840 Branch: refs/heads/master Commit: aa90d840817101847626fed6e1388779d51d631a Parents: 20aa1d7 Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Tue Sep 6 17:07:26 2016 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Tue Sep 6 17:08:44 2016 +0100 ---------------------------------------------------------------------- .../core/provisioning/camel/SyncopeCamelContext.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/aa90d840/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java index d034f08..d57c421 100644 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java +++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java @@ -109,6 +109,16 @@ public class SyncopeCamelContext { } else if (!camelContext.getRouteDefinitions().isEmpty()) { camelContext.getRouteDefinitions().remove(camelContext.getRouteDefinition(routeKey)); loadContext(Collections.singletonList(routeDAO.find(routeKey))); + + // Start the Camel Context if it's stopped, as maybe this update fixes a previous route error which + // caused startup to fail + if (camelContext.isStopped()) { + try { + camelContext.start(); + } catch (Exception e) { + LOG.error("While restarting Camel context", e); + } + } } }