Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
2.16.0
-
None
-
None
-
Unknown
Description
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.
RoutesCollector.java
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"); } }
If you agree I'll attach a patch.
Attachments
Issue Links
- duplicates
-
CAMEL-9161 Camel spring-boot not finding routes when using spring-cloud
- Resolved