Skip to content

Send messages to the DLQ before deleting from SQS #729

Closed
@VictorJuliani

Description

@VictorJuliani

Is your feature request related to a problem? Please describe.

I came across a problem where messages were failing and throwing exceptions, but they weren't sent to the DLQ. They were consumed as successful.

After investigation, I found out that the DLQ#SendMessage call from PowerTools was failing due to a missing KMS permission in my lambda.

That caused some messages to be lost from the queues.

Describe the solution you'd like

  1. Update the documentation to point out that Encrypt/Decrypt and GenerateDataKey* permissions are required if the SQS is encrypted (at least it's not documented here)
  2. Perform the DLQ#SendMessage call before the SQS#DeleteMessage (code ref) to make sure the message won't be lost in case of any DLQ misconfiguration.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions