Skip to content

Publish to FIFO queue with IMessagePublisher #340

@EtherZa

Description

@EtherZa

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.

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

    builder.AddSNSPublisher<BidInfo>(
        "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

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions