This is a very simple DotNet Standard 2.0 package for receiving messages from AWS SQS in as simple a manner as I think is possible.
Source code is on github https://github.com/RokitSalad/Helpful.Aws.Sqs.Receiver
The package is available on nuget.org: https://www.nuget.org/packages/Helpful.Aws.Sqs.Receiver
The package provides a few useful features which you don’t get by default when using the AWS SDK directly:
- A default configuration which works for many situations.
- An internal queue to allow the receipt of multiple messages at once without adding complexity to the code receiving each message.
- Cancellation token handling which allows the internal queue to run to the end before terminating the service.
- Direct access to the internal queue as an IEnumerable, so you’ll never lose messages even in an exception state.
- 2 lines of code to receive your first message:
IMessageReceiver messageReceiver = ReceiverFactory.GetReceiver("your aws access key", "your aws secret key", "your aws region", "the url to your queue", CancellationToken.None);
ReceivedMessage message = await messageReceiver.NextMessageAsync();
There will be a handful of further features to follow, but the intention is for this to be as light weight as possible – it’s just to grease the cogs a little.