spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

Support Graalvm: org.springframework.experimental:spring-native

Open coderDem opened this issue 4 years ago • 1 comments

Hello,

we want to use the native image of spring boot to use GraalVM: https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/ and have an fast startime.

Our problem is that if we add the library we add also atomatic the SqsConfiguration. If we try to build the image we get this error:

Execution failed for task ':generateAot'.
> ERROR: in 'org.springframework.cloud.aws.messaging.config.annotation.SqsConfiguration' these methods are directly invoking methods marked @Bean: [simpleMessageListenerContainer] - due to the enforced proxyBeanMethods=false for components in a native-image, please consider refactoring to use instance injection. If you are confident this is not going to affect your application, you may turn this check off using -Dspring.native.verify=false.

If we look in the class: https://github.com/spring-cloud/spring-cloud-aws/blob/main/spring-cloud-aws-messaging/src/main/java/org/springframework/cloud/aws/messaging/config/annotation/SqsConfiguration.java

It has not the annotation: @Configuration(proxyBeanMethods = false)

But if we look in other configs like https://github.com/spring-cloud/spring-cloud-aws/blob/main/spring-cloud-aws-messaging/src/main/java/org/springframework/cloud/aws/messaging/config/annotation/SqsClientConfiguration.java

It has the annotation: @Configuration(proxyBeanMethods = false)

Have somebody an idea how solve the issue?

coderDem avatar Sep 16 '21 11:09 coderDem

I'm with the same problem.

marcelovbm avatar Sep 22 '21 12:09 marcelovbm