aws / aws/aws-dotnet-messaging

Publish to FIFO queue with IMessagePublisher

Open
#340 1 comment 3 reactions 0 assignees View on GitHub
feature-request p2 pr/needs-review queued
Dominant language
C#
Stars
143
Forks
27
Avg merge
1d 18h
Merged PRs (30d)
4

Description

### Describe the feature

Per message options configuration for SQS/SNS messages when using `IMessagPublisher`.

### Use Case

To support FIFO queues where there is sufficient detail in the message to determine the group/deduplication id's. Having the configuration at bootstrap abstracts the FIFO logic/requirement away from the code that publishes the message.

### Proposed Solution

Add optional configuration actions to `IMessageBusBuilder.AddSQSPublisher` and `IMessageBusBuilder.AddSNSPublisher` for `MessageRoutingPublisher` to pre-populate `SQSOptions`/`SNSOptions` before handing off to the specialised publishers.

```csharp
builder.Services.AddAWSMessageBus(builder =>
{
builder.AddSQSPublisher(
"https://sqs.us-west-2.amazonaws.com/012345678910/MyFifoQueue.fifo",
configureOptions: (message, options) =>
{
options.MessageGroupId = message.TransactionId;
options.MessageDeduplicationId = message.TransactionId;
});

builder.AddSNSPublisher(
"arn:aws:sns:us-west-2:012345678910:MyFifoTopic.fifo",
configureOptions: (message, options) =>
{
options.MessageGroupId = message.BidId;
options.MessageDeduplicationId = message.BidId;
});
});
```

### Other Information

Configuration supported by code configuration only.

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS.Messaging (or related) package versions

AWS.Messaging

### Targeted .NET Platform

*

### Operating System and version

*

Contributor guide

Open the contributing guide

Research direction

Start at IMessageBusBuilder.AddSQSPublisher and AddSNSPublisher, then trace how MessageRoutingPublisher hands messages to the specialised publishers and how SQSOptions and SNSOptions are populated. Confirm the per-message configuration shape in both publisher paths; done means FIFO group and deduplication IDs can be derived from each message without requiring configuration in the publishing code. Run the existing test suite and add focused coverage if the repository has publisher tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.