6

According to the latest version of the Spring Cloud AWS Docs (http://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html) section 5.2.3 states you need to configure the QueueMessageHandler by using the following in a traditional Spring XML config:

<aws-messaging:annotation-driven-queue-listener />

How do you configure the same using the more modern Java based config?

peterl
  • 1,881
  • 4
  • 21
  • 34

1 Answers1

0

I have found a related discussion on GitHub with a conclusion there is no direct configuration specified for this project yet.

These two bean definitions should be able to replace the whole XML configuration you mentioned above. However, it depends on the details you want to configure.

@Bean
public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory() {
    SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();        
    factory.setAmazonSqs(yourCustomClient);
    return factory;
}

@Bean
public QueueMessageHandlerFactory queueMessageHandlerFactory() {
    QueueMessageHandlerFactory factory = new QueueMessageHandlerFactory();
    factory.setAmazonSqs(yourCustomClient);
    return factory;
}
Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183