How would I configure Spring Cloud AWS XML config with annotations?
I am especially interested in changing default taskExecutor.
How would I configure Spring Cloud AWS XML config with annotations?
I am especially interested in changing default taskExecutor.
I found that there is SimpleMessageListenerContainerFactory
used to configure for AWS messaging via Java .
So changing default taskExecutor
is just matter for overriding this default container factory bean. Something like this:
@Bean
public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory(AmazonSQSAsync amazonSqs) {
SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();
factory.setAmazonSqs(amazonSqs);
Executor executor = Executors.newFixedThreadPool(1);
ConcurrentTaskExecutor taskExecutor = new ConcurrentTaskExecutor(executor);
factory.setTaskExecutor(taskExecutor);
return factory;
}