Reputation: 167
In our Spring boot application we use Spring Cloud AWS:
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?
Upvotes: 1
Views: 1515
Reputation: 121177
You have to declare @Bean
for the custom SimpleMessageListenerContainerFactory
, but still leave @EnableSql
and SqsConfiguration
will be @Autowired
with your customization.
Upvotes: 0