wonton
wonton

Reputation: 8287

moto upgrade results in error The queue should either have ContentBasedDeduplication enabled or MessageDeduplicationId provided explicitly

I upgraded moto from 4.1.x to 4.2.x and now I am hitting this error when I run my pytest unit tests.

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendMessage operation: The queue should either have ContentBasedDeduplication enabled or MessageDeduplicationId provided explicitly

What is going on and how do I fix this?

Upvotes: 0

Views: 235

Answers (1)

wonton
wonton

Reputation: 8287

The solution that worked for me was to add "ContentBasedDeduplication": "true" as an attribute on the queue, ie

    queue = client.create_queue(
        QueueName=queue_name,
        Attributes={
            ....
            "ContentBasedDeduplication": "true",
        }
    )

The way SQS deduplication works appears to have been changed by this commit which landed in 4.1.7 and was picked up as a part of the package upgrade.

Upvotes: 2

Related Questions