Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.16.1
-
None
Description
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();
}
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
Attachments
Attachments
Issue Links
- relates to
-
CAMEL-11008 Consumer/Producer templates are not stopped when auto-configured in Spring Boot
- Resolved
-
CAMEL-11261 Revise Camel context destruction in Spring (Boot) applications
- Resolved