How to avoid: "Request throttled because message visibility configuration was updated too recently."

0

I am getting the following error when calling ChangeMessageVisibility:

Request throttled because message visibility configuration was updated too recently.

I can't find anything on google or on here as to how to fix this. I've tried waiting up to 43 seconds after creating the queue to see if calls to ChangeMessageVisibility have to occur after the (30 second) VisibilityTimeout setting itself, but no dice. The FIFO in question is created in an automated (pytest) fixture and all of the other ways we use that fixture work great. It's just this call to ChangeMessageVisibility.

How can I fix this? Thanks!

asked 2 years ago465 views
1 Answer
0

Silly question: Are you definitely calling the ChangeMessageVisibility API for a message or trying to change the default VisibilityTimeout by calling SetQueueAttributes? Because the error message implies that that it is the queue configuration that is being changed, not the message visibility.

That said: Information that is missing that would be handy: What's the default message visibility timeout for the queue? What are you setting the message visibility to? How often are you doing that?

I ask because: If you have delays in your processing that are happening frequently, maybe it's a sign to change the default message visibility in the queue or to set the individual message visibility a lot higher rather than trying to set it a lot of times.

profile pictureAWS
EXPERT
answered 2 years ago
  • Thanks for your reply. I am getting the error when calling queue.change_message_visibility_batch(). The queue object is created like this:

        incoming = client.create_queue(
            QueueName="TEST-INCOMING.fifo",
            Attributes={"FifoQueue": "true", "ContentBasedDeduplication": "false", "VisibilityTimeout": "30"},
        )
    

    Putting back messages is a slight but important edge case for us when a customer is tearing down their account while an SQS consumer is also processing messages for that account.

    Does that answer your questions?

  • I'm running into the same situation. Using Change Message Visibility Batch API (via .NET SDK). It is also a FIFO queue. We pull off a batch of 10, determine if any of those messages can be consolidated, and handle them, then "put the rest back" (by changing the message visibility on the messages back to zero). We are getting this error intermittently.

    The full error I get is:

    Request throttled because message visibility configuration was updated too recently. Wait a short while and then retry the operation.

    What is the "short while" we should wait?

    What's the default message visibility timeout for the queue? 15 minutes What are you setting the message visibility to? Zero How often are you doing that? Varies, sometimes may be as quick as a few seconds.

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.

Guidelines for Answering Questions