Assuming:
- there is AWS Lambda that processes messages in 10-elements batches from AWS SQS FIFO queue with 25 available message group ids (assign in a random fashion)
- the processing of a single message takes ~30-60 sec
- SQS message visibility timeout is set to 10 min
- integration trigger Lambda-SQS has 'Partial batch response' enabled
When Lambda returns a partial batch response with ids of the failed messages, e.x.:
{
"batchItemFailures": [
{
"itemIdentifier": "d4c7c57f-c12c-4639-abe3-3a0d37690790"
}
]
}
The successfully processed messaged are deleted from the queue. However, the failed messages from the batch are still waiting for the visibility timeout instead of being made visible to the consumers immediately. Is the behaviour for failed messages correct? Or the only way to make them visible immediately is to call SQS API and change visibility timeout to 0?