code_samples
code_samples copied to clipboard
Redrive policy and message deletion
Hi
https://perandrestromhaug.com/posts/writing-an-sqs-consumer-in-python/
Excellent article, I'm just wondering if your code example has a mistake referenced below. It looks like you are deleting the message regardless if an exception has happened. Shouldn't you place the message.delete() in the TRY block so failed messages will eventually get to the DLQ? Or am I not understanding this?
Thanks! Chang
https://github.com/Pastromhaug/code_samples/blob/50c52fd2b07183df8abb783e6b6fb15b44ce27e6/sqs_consumer/sqs_consumer.py#L24