code_samples icon indicating copy to clipboard operation
code_samples copied to clipboard

Redrive policy and message deletion

Open xcf33 opened this issue 4 years ago • 0 comments

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

xcf33 avatar Sep 13 '22 20:09 xcf33