1

In our Spring boot application we use Spring Cloud AWS:

  • spring-cloud-starter-aws
  • spring-cloud-aws-autoconfigure
  • spring-cloud-aws-messaging

to receive messages from a SQS queue. However we need to be able to start the application even if the queue is not accessible (i.e "(Service: AmazonSQS; Status Code: 403; Error Code: AccessDenied"). In order to do that, we need to be able to override the org.springframework.cloud.aws.messaging.config.annotation.SqsConfiguration class, and provide our own implementation of org.springframework.cloud.aws.messaging.listener.SimpleMessageListenerContainer.

What is the correct way to do this, and not break autowiring in our existing code?

Ostap Koziy
  • 167
  • 1
  • 2
  • 9
  • 1
    Related question http://stackoverflow.com/questions/40092518/how-to-configure-custom-spring-cloud-aws-simplemessagelistenercontainerfactory-s. – Artem Bilan Oct 17 '16 at 17:46

1 Answers1

0

You have to declare @Bean for the custom SimpleMessageListenerContainerFactory, but still leave @EnableSql and SqsConfiguration will be @Autowired with your customization.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118