[
https://issues.apache.org/jira/browse/CAMEL-8906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14604720#comment-14604720
]
ASF GitHub Bot commented on CAMEL-8906:
---------------------------------------
GitHub user bassmake opened a pull request:
https://github.com/apache/camel/pull/549
CAMEL-8906: destroy method
I wasn't able to write test for this functionality.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bassmake/camel CAMEL-8906
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/549.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 #549
----
commit bf6e73e27084e4891631415dd70cb70b2e89d389
Author: bsmk <[email protected]>
Date: 2015-06-28T15:10:26Z
CAMEL-8906: destroy method
----
> Application hangs when Spring Boot Actuator shutdown hook is used
> -----------------------------------------------------------------
>
> Key: CAMEL-8906
> URL: https://issues.apache.org/jira/browse/CAMEL-8906
> Project: Camel
> Issue Type: Sub-task
> Components: camel-spring-boot
> Affects Versions: 2.15.2
> Reporter: Miroslav Matejovsky
>
> 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:
> {code}
> @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();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)