camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henryk Konsek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-8906) Application hangs when Spring Boot Actuator shutdown hook is used
Date Fri, 26 Jun 2015 10:26:05 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-8906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14602665#comment-14602665
] 

Henryk Konsek commented on CAMEL-8906:
--------------------------------------

Hi Miroslav,

Please do create pull request - I will merge it. Maybe one thing - can we try to add {{completed()}}
method to the {{CamelSpringBootApplicationController}} instead of using the reflection? Thanks!

Cheers!

> 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)

Mime
View raw message