I have an SQS FIFO queue that uses thousands of message group ids for ordering and exactly-once processing.
Most messages are processed quickly by the consumer, and deleted from the queue.
However since some messages can take a while to process, the VisibilityTimeout
on the queue is 2 hours.
Occasionally I'll end up with one or two messages showing as available in my queue, but they're not receivable because a message with the same message group id is in-flight.
I know I can't receive these messages, but is there any way to view the messages to know which message group id is causing issues?
Unfortunately, you can't view in-flight messages as they are simply not visible to other consumers.
However, if you have some messages that cause issues, e.g., they are non-receivable, you may consider setting up dead letter queue (DLQ):
Dead-letter queues are useful for debugging your application or messaging system because they let you isolate problematic messages to determine why their processing doesn't succeed.
This way these "bad" messages will end up in a DLQ, which will allow you to inspect them, be automatically notified about their presence or process them in a different way.