I am using @SqsListener provided by Spring cloud API in order to consume messages from FIFO queue. I want to consume the messages based on the particular Message Group ID. Not sure on where to configure this setting.
I tried to read AWS spring cloud documentation and did some google but cannot find a answer or example.
My annotation looks like this:
@SqsListener(value = orderQueue, deletionPolicy = SqsMessageDeletionPolicy.ON_SUCCESS)
And I have following SQS config:
public QueueMessagingTemplate queueMessagingTemplate(AmazonSQSAsync amazonSQSAsync) {
return new QueueMessagingTemplate(amazonSQSAsync);
}
and using following dependency:
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws-messaging</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
I am mainly looking for answer on how to configure @SqsListener to read messages based on Message Group Id.