Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Using FIFO with the AWS Message Processing Framework for .NET - AWS SDK for .NET

Using FIFO with the AWS Message Processing Framework for .NET

Note

This is prerelease documentation for a feature in preview release. It is subject to change.

For use cases where message ordering and message deduplication are critical, the AWS Message Processing Framework for .NET supports first-in-first-out (FIFO) Amazon SQS queues and Amazon SNS topics.

Publishing

When publishing messages to a FIFO queue or topic, you must set the message group ID, which specifies the group that the message belongs to. Messages within a group are processed in order. You can set this on the SQS-specific and SNS-specific message publishers.

await _sqsPublisher.PublishAsync(message, new SQSOptions { MessageDeduplicationId = <message-deduplication-id>, MessageGroupId = <message-group-id> });

Subscribing

When handling messages from a FIFO queue, the framework handles messages within a given message group in the order in which they were received for each ReceiveMessages call. The framework enters this mode of operation automatically when configured with a queue ending in .fifo.

await Host.CreateDefaultBuilder(args) .ConfigureServices(services => { // Register the AWS Message Processing Framework for .NET. services.AddAWSMessageBus(builder => { // Because this is a FIFO queue, the framework automatically handles these messages in order. builder.AddSQSPoller("https://sqs.us-west-2.amazonaws.com/012345678910/MPF.fifo"); builder.AddMessageHandler<OrderMessageHandler, OrderMessage>(); }); }) .Build() .RunAsync();
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.