Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 1.07 KB

README.md

File metadata and controls

30 lines (25 loc) · 1.07 KB

SQS message listener with spring boot 3

Add following in pom.xml

<dependency>
    <groupId>io.awspring.cloud</groupId>
    <artifactId>spring-cloud-aws-starter-sqs</artifactId>
</dependency>

<!-- Use BOM provided by spring for version managament -->
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.awspring.cloud</groupId>
            <artifactId>spring-cloud-aws-dependencies</artifactId>
            <version>3.0.1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
  • Use io.awspring.cloud.sqs.annotation.SqsListener to listen the messages instead of io.awspring.cloud.messaging.listener.annotation.SqsListener
  • If "Visibility timeout" of SQS is less than listener's processing time then message needs to be deleted explicitly from the queue, otherwise same message could be processed multiple times.

Check reference for more details.