Repository: camel Updated Branches: refs/heads/master 4a044d882 -> 692dbc058
CAMEL-10034: Camel health in camel-spring-boot should be optional. Thanks to Nicola Ferraro for reporting. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/692dbc05 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/692dbc05 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/692dbc05 Branch: refs/heads/master Commit: 692dbc058f2e52b90763bb38ce62e8f7af7125b3 Parents: 4a044d8 Author: Claus Ibsen <davscl...@apache.org> Authored: Thu Jun 9 11:10:16 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu Jun 9 11:10:16 2016 +0200 ---------------------------------------------------------------------- .../boot/health/CamelHealthAutoConfiguration.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/692dbc05/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/health/CamelHealthAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/health/CamelHealthAutoConfiguration.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/health/CamelHealthAutoConfiguration.java index 772ced1..2c96626 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/health/CamelHealthAutoConfiguration.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/health/CamelHealthAutoConfiguration.java @@ -26,13 +26,19 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration +@ConditionalOnClass({HealthIndicator.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) public class CamelHealthAutoConfiguration { - @Bean @ConditionalOnClass({CamelContext.class}) @ConditionalOnMissingBean(CamelHealthIndicator.class) - public HealthIndicator camelHealthIndicator(CamelContext camelContext) { - return new CamelHealthIndicator(camelContext); + protected static class CamelHealthIndicatorInitializer { + + @Bean + public HealthIndicator camelHealthIndicator(CamelContext camelContext) { + return new CamelHealthIndicator(camelContext); + } + } + }