This reactive sqs consumer built with aim to reduce the boilerplate code to launch the sqs consumer and allow the developers to focus on processing the message for implement the business logic. This has been built from the scratch with a goal making it easy to customizable allowing each component of the library is easy to interchangeable if desired. This also, allows us define custom configuration such as amount of thread to fetch messages and amount of threads to process the messages etc.
The distinguished feature of reactive sqs consumer are
- Its truly non blocking implementation to maximize throughput and optimize resource utilization by leveraging Asynchronous AWS SDK for Java 2.0 and Kotlin > Flow
- automatic handling of back pressure between MessageProvider and MessageHandler by using kotlin flows.
- customize the no of concurrent MessageProvider and concurrent no of MessageHandler through configuration.
- abstraction of complexity for fetching and deleting the sqs messages.
- automatic exception handling of messages using Dead-Letter Queues
- better control of defining polling logic for DLQ message by implementing PollingStrategy
- reduce cost by leveraging Long Polling
This library is divided into four sub components each with its own responsibilities. The below diagram shows the simple flow of sqs message lifecycle flowing throw each components.
See ExampleUsage.kt for how to use this library.