SQS distinguish between duplicate and failed/retry messages?

天大地大妈咪最大 提交于 2019-12-13 03:48:43

问题


I am writing an application in Lambda that is invoked by SQS messages.

I would like to be able to tell the difference between an invocation resulting from a "duplicate" message vs one resulting from a previous failure/retry (both SQS and Lambda will retry in case of failure).

Is the messageId the same for duplicate messages, or just the body? If they are different I might be able to track a messageId against a key from the body to identity duplicates.

TIA.


回答1:


Ideally, you would want to store the message id some kind of database once you successfully process the message. And the next time around if you get a message with a message id already present in your store, you will know that this has been successfully processed.



来源:https://stackoverflow.com/questions/51937217/sqs-distinguish-between-duplicate-and-failed-retry-messages

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