Richie
Richie

Reputation: 5189

Is it possible to enrich a message on an sqs queue

I have a message I am reading off an sqs queue. If the operation I am performing succeeds I delete the message from the queue.

But if the operation fails I was thinking of enriching the message on the queue to have some extra information about the failure.

Is enriching a message on the queue (between reading and deleting) possible using sqs?

Upvotes: 5

Views: 1503

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269081

No. It is not possible to update/modify a message in the queue.

Each time a message is retrieved, it increments the ApproximateReceiveCount (the number of times a message has been received from the queue but not deleted), but otherwise the message cannot be modified.

Instead, you could store supplemental information in a database (eg DynamoDB) indexed by MessageId, and retrieve that information when processing a message.

Upvotes: 4

Related Questions