[
https://issues.apache.org/jira/browse/CAMEL-9294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-9294.
--------------------------------
Resolution: Duplicate
Assignee: Claus Ibsen
It is a duplicate of recent tickets about spring boot and spring cloud. Should
be fixed in the upcoming 2.16.1 release.
> Camel spring boot doesn't pickup routes when context refresh event is not
> called on the root context
> ----------------------------------------------------------------------------------------------------
>
> Key: CAMEL-9294
> URL: https://issues.apache.org/jira/browse/CAMEL-9294
> Project: Camel
> Issue Type: Bug
> Components: camel-spring-boot
> Affects Versions: 2.16.0
> Reporter: Denis Stepanov
> Assignee: Claus Ibsen
>
> RoutesBuilders doesn't get picked-up when Spring Cloud Config is included on
> the classpath, I think it uses some mechanism for properties refresh, by
> that, application context is ignored and code bellow will not do the
> initialisation.
> My propose would be to always initialise and log an additional information if
> you think there could be a problem without the root context.
> {code:title=RoutesCollector.java|borderStyle=solid}
> public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
> ApplicationContext applicationContext =
> contextRefreshedEvent.getApplicationContext();
> if (applicationContext.getParent() == null) {
> // This will not get called when Spring Cloud Config is included
> on classpath
> } else {
> LOG.debug("Not at root context - defer adding routes");
> }
> }
> {code}
> If you agree I'll attach a patch.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)