1

I have a service which integrate with AWS SQS. Some of our messages take longer than 12 hour(maximum visibility timeout) to process.

In this case, other consumers will pick up the same message after visibility timeout while the message is still being processed.

I am wondering what's the best practice for such cases. I can add de-duplication logic before processing messages but in this case, if the first consumer fail to process the message then the message won't go into DLQ.

Any suggestion would be appreciated!

2 Answers 2

1

I believe you can simply have your worker call ChangeMessageVisibility periodically to extend the timeout.

AWS SQS Visibility Timeout Explained provides some good details.

0

The best practice is not to use SQS (or any other queue), but a technology that supports long processes. AWS has Step Functions and Simple Workflow created for that specific purpose.

You can also consider using temporal.io which is an open source successor of the Simple Workflow.

Not the answer you're looking for? Browse other questions tagged or ask your own question.