oshai
oshai

Reputation: 15355

in SQS - Does a change in visibility timeout affects In-flight messages

I have a queue with one "heavy" message being sent/receive occasionally.

The configured visibility timeout is currently at the maximum of 12 hours.

However, I identified the message got stuck on the consumer, and I want to return it to the queue for a retry (so it will be consumed again by another consumer).

Does reducing the visibility timeout (temporarily) affect message already in-flight?

Is there any other way to force making the message visible?

Upvotes: 3

Views: 1235

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269081

If you have the ReceiptHandle for a message, you can call change_message_visibility().

The Receipt Handle refers to the specific 'fetch' of the message, rather than the message itself. The ReceiptHandle value is provided in response to the ReceiveMessage() command, so it is only available to the code that actually retrieved the message from the queue.

Upvotes: 1

Related Questions