This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 8f24c4d CAMEL-12134: avoid creating multiple contexts when using xml in spring-boot 8f24c4d is described below commit 8f24c4d0ae8cf15027fc5f5bcfcfde8b99ccc245 Author: Nicola Ferraro <ni.ferr...@gmail.com> AuthorDate: Wed Jan 10 14:14:54 2018 +0100 CAMEL-12134: avoid creating multiple contexts when using xml in spring-boot --- .../java/org/apache/camel/spring/CamelContextFactoryBean.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java index 6f5b00a..b4d977c 100644 --- a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java +++ b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java @@ -449,6 +449,13 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr SpringCamelContext ctx = newCamelContext(); ctx.setName(getId()); + return ctx; + } + + /** + * Apply additional configuration to the context + */ + protected void configure(SpringCamelContext ctx) { try { // allow any custom configuration, such as when running in camel-spring-boot if (applicationContext.containsBean("xmlCamelContextConfigurer")) { @@ -461,8 +468,6 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr // error during configuration throw ObjectHelper.wrapRuntimeCamelException(e); } - - return ctx; } protected SpringCamelContext newCamelContext() { @@ -472,6 +477,7 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr public SpringCamelContext getContext(boolean create) { if (context == null && create) { context = createContext(); + configure(context); } return context; } -- To stop receiving notification emails like this one, please contact ['"commits@camel.apache.org" <commits@camel.apache.org>'].