GitHub user zregvart opened a pull request: https://github.com/apache/camel/pull/1797
CAMEL-11476: spring-boot - routes not loaded when setting a management.port @nicolaferraro would you mind taking a look, thanks ð Fixes `RouteBuilder` (Java DSL) based routes not loading when setting `management.port` Spring Boot property by removing the 'same application context' check. Also removes `maybeStart` method to start the Camel context from `RoutesCollector`, startup is now handled in `SpringCamelContext`. When customizing the `management.port` configuration option Spring Boot creates a new `ApplicationContext` instance which when started emits a `ContextRefreshedEvent` that is different from the `ApplicationContext` the `RoutesCollector` is initialized with. Due to change in CAMEL-11261, `SpringCamelContext` is started via the same `ContextRefreshedEvent`, at the point the second `ContextRefreshedEvent` emited from the `ApplicationContext`, that `RoutesCollector` is initialized with, `SpringCamelContext` is already started and no Java DSL routes are added to Camel context. You can merge this pull request into a Git repository by running: $ git pull https://github.com/zregvart/camel CAMEL-11476 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/1797.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1797 ---- commit 3ab5ce9c61daf2d50f2f33ac78dfa189aa2cd1a8 Author: Zoran Regvart <zregv...@apache.org> Date: 2017-06-29T08:42:07Z CAMEL-11476: spring-boot - routes not loaded wh... ...en setting a management.port Fixes `RouteBuilder` (Java DSL) based routes not loading when setting `management.port` Spring Boot property by removing the 'same application context' check. Also removes `maybeStart` method to start the Camel context from `RoutesCollector`, startup is now handled in `SpringCamelContext`. When customizing the `management.port` configuration option Spring Boot creates a new `ApplicationContext` instance which when started emits a `ContextRefreshedEvent` that is different from the `ApplicationContext` the `RoutesCollector` is initialized with. Due to change in CAMEL-11261, `SpringCamelContext` is started via the same `ContextRefreshedEvent`, at the point the second `ContextRefreshedEvent` emited from the `ApplicationContext`, that `RoutesCollector` is initialized with, `SpringCamelContext` is already started and no Java DSL routes are added to Camel context. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---