Skip to content

Does AWS SNS FIFO deduplication apply only within the same MessageGroupId?

0

My understanding is:

AWS preserves the order of messages within each MessageGroupId. Messages are only considered duplicates if they have the same MessageDeduplicationId and are sent within the 5-minute deduplication window within the same MessageGroupId; messages with the same MessageDeduplicationId but different MessageGroupIds are not treated as duplicates.

Can someone please confirm if deduplication is only enforced within each MessageGroupId, and not across different groups?

For example, if I send two messages with the same MessageDeduplicationId but different MessageGroupIds, will both messages be delivered within 5-minute deduplication window?

asked a year ago340 views

2 Answers
1

The scope of deduplication in AWS SNS FIFO topics depends on the FifoThroughputScope attribute setting:

  1. When FifoThroughputScope is set to Topic, message deduplication applies across the entire topic, regardless of message group IDs. In this case, if you send two messages with the same MessageDeduplicationId but different MessageGroupIds within the 5-minute deduplication interval, only the first message will be delivered, and the second will be considered a duplicate.

  2. When FifoThroughputScope is set to MessageGroup, message deduplication applies only within each individual message group. In this scenario, if you send two messages with the same MessageDeduplicationId but different MessageGroupIds within the 5-minute deduplication interval, both messages will be delivered because they belong to different message groups.

So your understanding is partially correct - deduplication can be enforced either across the entire topic or only within each MessageGroupId, depending on how the FifoThroughputScope attribute is configured. The default behavior depends on how you've set up your FIFO topic.

Every message sent to a FIFO topic must have a unique MessageDeduplicationId within the applicable deduplication scope and interval. If a message with a particular MessageDeduplicationId is sent successfully, subsequent messages with the same MessageDeduplicationId within the deduplication scope and 5-minute interval will be accepted but not delivered.
Sources
Amazon SNS message deduplication for FIFO topics - Amazon Simple Notification Service
PublishBatchRequestEntry - Amazon Simple Notification Service
Publish - Amazon Simple Notification Service

answered a year ago

EXPERT

reviewed a year ago

0

Thanks for the update. if FifoThroughputScope is not defined during SNS creation then it gets defaults to Topic ?

answered a year ago

  • Referring to the AWS documentation:
    https://docs.aws.amazon.com/sns/latest/dg/fifo-high-throughput.html#enable-high-throughput-on-fifo-topic By default Amazon SNS FIFO topics are configured for topic-level deduplication, this is controlled by the topic attribute FifoThroughputScope set to Topic, but I can't find this attribute in the AWS Console for the SNS or when running below command:

    aws sns get-topic-attributes --topic-arn <your-topic-arn> --profile <your-profile-name> --region <your-region>

    Is this attribute hidden, only available under certain conditions, or am I missing something? Any guidance would be appreciated.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.