so I am trying to build a queue (fifo) with a worker lambda. Simple enough and it works. But in case of an error, I want to reliably mark the failed workload as failed in a database (no retries!).
For some errors, I could just use a try-catch block. But in case of other issues (timeout e.g.), the lambda function just fails. The sqs message is "stuck" in "In-Flight" until visibility timeout is reached. Because the visibility timeout is quite high (lambda itself can run ~10min), the message gets put into the SQSs DLQ very late.
Lambda Destinations don't work because it is not triggered asynchronously.
Is there a reliable way to immediately react to a failed lambda execution when triggered by SQS?