amazon-web-servicesamazon-sqsamazon-snsdead-letter

AWS DLQ for two consumers, what is best practice?


Have Consumer that should process DLQ queue messages also want additionally log information about messages that come to DLQ by Lambda.

See two possible solutions.

from these two solutions on image which are more reliable and correct from AWS point of view?

Maybe any other ways to achieve this?

Considering that "Other Consumer" may be down and not reachable sometimes

enter image description here


Solution

  • Approach 2 - using SNS to distribute a message to multiple endpoints is the "AWS" way. In approach 1 your lambda is a potential point of failure, in option 2 it doesnt matter if your lambda fails or not the message always gets to DLQ2.

    Other Consumer behavior is probably irrelevant - so long as it consumes messages before they expire and you dont hit any rate or size limits etc. it should work regardless.

    You might also want a DLQ for the lambda in case it fails.