Details
-
Type:
Sub-task
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.15.2
-
Component/s: camel-spring-boot
-
Labels:None
-
Estimated Complexity:Unknown
Description
After some investigation:
- org.apache.camel.spring.boot.CamelSpringBootApplicationController creates org.apache.camel.main.MainSupport instance
- MainSupport.waitUntilCompleted() will hang on latch.await()
- To release this lock MainSupport.completed() has to be called. But this never happens
- CamelSpringBootApplicationController should implement @PreDestroy callback and call mainSupport.completed()
- Workaround:
@Autowired private CamelSpringBootApplicationController camelSpringBootApplicationController; @PreDestroy public void preDestroy() throws Exception { final Field f = camelSpringBootApplicationController.getClass().getDeclaredField("mainSupport"); f.setAccessible(true); MainSupport mainSupport = (MainSupport) f.get(camelSpringBootApplicationController); mainSupport.completed(); }