spring-attic / spring-cloud-aws

All development has moved to https://github.com/awspring/spring-cloud-aws Integration for Amazon Web Services APIs with Spring
https://awspring.io/
Apache License 2.0
591 stars 373 forks source link

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

Open coderDem opened 3 years ago

coderDem commented 3 years ago

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?

marcelovbm commented 3 years ago

I'm with the same problem.