You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/07/01 10:05:04 UTC

[jira] [Resolved] (CAMEL-8906) Application hangs when Spring Boot Actuator shutdown hook is used

     [ https://issues.apache.org/jira/browse/CAMEL-8906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-8906.
--------------------------------
    Resolution: Fixed

> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.16.0, 2.15.3
>
>
> 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)