From AWS documentation:
An Amazon SQS message has three basic states:
Enqueued (Stored): A message is considered "stored" or "enqueued" after it is sent to a queue by a producer, but not yet received from the queue by a consumer. This is the initial state when a message first arrives in the queue and is waiting to be processed. There is no limit to the number of stored messages.
Pending (In Flight): A message is considered "in flight" or "pending" after it is received from a queue by a consumer, but not yet deleted from the queue. During this state, the message becomes temporarily invisible to other consumers due to the visibility timeout mechanism. This prevents multiple consumers from processing the same message simultaneously. There is a limit to the number of in-flight messages (120,000 for standard queues and FIFO queues).
Dequeued (Deleted): A message is "dequeued" when it is deleted from the queue after successful processing. This is the final state where the message is permanently removed from the queue.
Key Points:
Message Locking: When a message is received (becomes pending/in-flight), it becomes "locked" while being processed, preventing other consumers from processing it simultaneously.
Visibility Timeout: If message processing fails, the lock expires after the visibility timeout period, and the message becomes available again (returns to stored state).
Automatic Deletion: Messages are automatically deleted if they remain in the queue longer than the maximum message retention period (default is 4 days, configurable up to 14 days).