Teodoro
Teodoro

Reputation: 1474

Return from lambda trigger without deleting the message from queue

In my lambda function I send the receiptHandle as body data to a server. Then, this server must do the work and tell SQS to delete this message.
The problem is that the aws docs says:

...
If your function successfully processes the batch, Lambda deletes the messages from the queue. If your function is throttled, returns an error, or doesn't respond, the message becomes visible again.

Which means that if I delegate the SQS message deletion to another service and end the Lambda execution, the SQS message will be deleted by this Lambda exit, which I don't want to happen. The message's visibility timeout should remain the same also.
Is there a way to accomplish this?

Upvotes: 1

Views: 2319

Answers (1)

Bruno Reis
Bruno Reis

Reputation: 37822

Is there a way to accomplish this?

No. The built-in SQS -> Lambda integration works that way (i.e., it deletes a messages from SQS once the Lambda Function returns successfully, like explained in the docs you linked and quoted), and it is not configurable.

[...] which I don't want to happen.

Why do you want to delegate the SQS message deletion to another service? What are you really trying to achieve?

Upvotes: 3

Related Questions