The "message not exist" error occurs when you delete a message in Simple Message Queue (formerly MNS) with an expired receipt handle. Adjust the VisibilityTimeout parameter to resolve this issue.
Issue
The following error message appears when you delete a message in SMQ:
message not exist
Cause
The receipt handle becomes invalid after the visibility timeout period ends:
-
When a consumer receives a message, its status changes from active to inactive.
-
During the
visibility timeout period, you can delete the message. -
After the
visibility timeout periodends, the message becomes active again. Other consumers can consume it and the receipt handle becomes invalid. -
Deleting a message with an invalid receipt handle returns the "message not exist" error.
Solution
Set VisibilityTimeout to a value that allows enough time to process and delete messages, and delete the message the next time it is received. Consider these trade-offs:
-
A value that is too small may not allow enough time to delete the message before the handle expires.
-
A
VisibilityTimeoutvalue that is too large delays reprocessing after a failed attempt.