Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating bean with name 'sqsAsyncClient' error when spring boot 3.1.2 use awspring-cloud 3.0.2 #929

Closed
lebkset opened this issue Oct 30, 2023 · 3 comments
Labels
component: sqs SQS integration related issue

Comments

@lebkset
Copy link

lebkset commented Oct 30, 2023

Type: Bug

Component:

Describe the bug
I used awspring-cloud 3.0.2 in Spring-boot 3.1.2 use SqsAutoConfiguration then raise error message :
Error creating bean with name 'sqsAsyncClient' defined in class path resource [io/awspring/cloud/autoconfigure/sqs/SqsAutoConfiguration.class]: Could not generate CGLIB subclass of class software.amazon.awssdk.services.sqs.DefaultSqsAsyncClient: Common causes of this problem include using a final class or a non-visible

Sample
If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.

@lebkset lebkset changed the title Creating bean with name 'sqsAsyncClient' when spring boot 3.1.2 use awspring-cloud 3.0.2 Creating bean with name 'sqsAsyncClient' error when spring boot 3.1.2 use awspring-cloud 3.0.2 Oct 30, 2023
@maciejwalkowiak
Copy link
Contributor

@lebkset can you provide a sample project that reproduces this issue?

@maciejwalkowiak maciejwalkowiak added component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer labels Oct 30, 2023
@lebkset
Copy link
Author

lebkset commented Oct 30, 2023

@maciejwalkowiak I can only provide some class such as bellow :
I have SqsConfiguration :

@Configuration
@Import(SqsBootstrapConfiguration.class)
public class SqsConfiguration {

  @Bean
  public SqsMessageListenerContainerFactory<Object> defaultSqsListenerContainerFactory(SqsAsyncClient sqsAsyncClient) {
    SqsMessageListenerContainerFactory<Object> factory = new SqsMessageListenerContainerFactory<>();
    factory.setSqsAsyncClient(sqsAsyncClient);
    return factory;
  }
}

and I have component run Aspect Before for check healthy application :

@Component
@Aspect
public class HealthMonitoringAspect {

  private final PollingTime pollingTime;

  public HealthMonitoringAspect(PollingTime pollingTime) {
    this.pollingTime = pollingTime;
  }

  @Before("execution(* software.amazon.awssdk.services.sqs.SqsAsyncClient.receiveMessage("
          + "software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest))")
  public void beforeCallSqsReceive() {
    pollingTime.update();
  }
}

when deploy application then show log error such as title , I can fix temporary use config such as bellow in application.yaml file :

aop:
   proxy-target-class: false

@maciejwalkowiak
Copy link
Contributor

Since DefaultSqsAsyncClient is a class from AWS SDK, I am sorry but we can't do much here.

@maciejwalkowiak maciejwalkowiak removed the status: waiting-for-feedback Waiting for feedback from issuer label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sqs SQS integration related issue
Projects
None yet
Development

No branches or pull requests

2 participants