GH-3828: Initial Spring AOT support
Fixes https://github.com/spring-projects/spring-integration/issues/3828
- Provide an infrastructure based on a new Spring AOT engine in the latest Spring Framework
- Introduce
RuntimeHintsRegistrarimpls into modules which require some reflection, resources or proxies and serialization available in the native image - Mark some framework method with the
@Reflectiveto make their reflection info available in the native image, for example for SpEL or JMX invocations - Add a
GatewayProxyBeanRegistrationAotProcessorto register proxy interfaces info for messaging gateways (either instance of theGatewayProxyFactoryBean) - Rework
ConverterRegistrarto not use abeanFactory.getBeansWithAnnotation()since it is not available after AOT phase. Instead, register an intermediateIntegrationConverterRegistrationbean definition from theIntegrationConverterInitializer - Refactor
GlobalChannelInterceptorInitializera bit according to a new logic in theIntegrationConverterInitializer - Remove
JsonNodeWrapperToJsonNodeConverterbean registration from theDefaultConfiguringBeanFactoryPostProcessor- it is added by theConverterRegistrarinto the targetConversionService - Fix
ParentContextTestsrespectively aJsonNodeWrapperToJsonNodeConverterbean removal - Refactor
XsltPayloadTransformerto not load aServletContextResource, but just use its name for thexslResourcecondition
@mhalbritter, FYI.
Would be great if you review this and leave some your feedback.
I tested the solution against the mentioned integration application in Spring Native at sb-3.0.x branch.
It works well without Spring Data. Its failure, though, is not relevant to Spring Integration: Spring Data team investigates some effort for inner bean with Spring AOT.
Perhaps I will need more serialization hints when my GenericJackson2JsonRedisSerializer is available with Spring Data fix. But this one can simply go to the next PR/commit.
Thanks
Hey @artembilan,
i've looked at the code and left some comments. I can't tell if the bean factory stuff is fine, as I don't have enough knowledge in Spring Integration / Spring Framework internals yet. Maybe asking for review from one of the more experienced colleagues helps :)
@sdeleuze , @mhalbritter , @snicoll ,
it looks like I have answered for all your questions and we have some plan going forward in the https://github.com/spring-projects/spring-integration/issues/3844. Is there anything what keeps us from merging this?
Thanks
Fine for me.
This is ready for review and possibly merge.
The PR for spring-aot-smoke-tests project is follow up.