AWS SQS Boto3 sending messages to dead letter manually

99封情书 提交于 2021-02-05 04:56:52

问题


So I am building a small application that uses SQS. I have a simple handler process that determines if a given message is considered processed, marked for retry (to be re-queued) or is not able to be processed (should be sent to dead letter).

However based on the docs it would appear the only way to truly send a message to DL is by using a redrive policy which operates over # of receives a message has racked up. Because of the nature of my application, I could have several valid retries if my process isn't ready to handle a given message, but there are also times I may want to DL a message I have just received. Does AWS/Boto3 not provide a way to mark a specific message for DL?

I know I can just send the message myself to another queue I consider my own DL, I would just rather use AWS' built in tools for this.


回答1:


I don't believe there is any limitation that would prevent you from sending the message to the deal-letter-queue by yourself.

So just read the message from the Q, if you know it needs to go to the DLQ directly, send it to the DLQ and remove it from the regular Q.



来源:https://stackoverflow.com/questions/50118340/aws-sqs-boto3-sending-messages-to-dead-letter-manually

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!