camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Chiarello (JIRA)" <>
Subject [jira] [Updated] (CAMEL-9431) TypeConverter autoconfiguration leads to invalid shutdown sequence
Date Thu, 17 Dec 2015 14:13:46 GMT


Laurent Chiarello updated CAMEL-9431:

Attached a JUnit Test Case to demonstrate the bug

> TypeConverter autoconfiguration leads to invalid shutdown sequence
> ------------------------------------------------------------------
>                 Key: CAMEL-9431
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot
>    Affects Versions: 2.16.1
>            Reporter: Laurent Chiarello
>         Attachments:
> When using autoconfiguration provided by the {{camel-spring-boot}} artifact,  a {{TypeConverter}}
bean is automatically registered into the Spring context: 
> {}
> @Bean
> TypeConverter typeConverter(CamelContext camelContext) {
>     return camelContext.getTypeConverter();
> }
> {code}
> The returned bean is an instance of {{DefaultTypeConverter}}, which in turn implements
{{ServiceSupport}} and its method {{public void shutdown()}}. This method is infered as a
_destroy-method_ by Spring, and called during the shutdown of the ApplicationContext. 
> As a consequence, the TypeConverter will be destroyed before the CamelContext, effectively
preventing any type conversion support for the inflight messages that have still to be processed
during the graceful shutdown period of Camel. 
> AFAIK the simple fix would be to disable the destroy-method inference using {{@Bean(destroyMethod="")}}.
This will let Camel have a chance to perform a clean shutdown in the right sequence. 
> As a workaround, it is possible to entirely disable the registration of the type converter
in Spring using the property
> {{camel.springboot.type-conversion = false}}

This message was sent by Atlassian JIRA

View raw message