When sending a message to an SQS Queue in AWS we can set a delay for the message to be visible to consumers of the queue for processing.
This can be done by setting a Delay
for the message.
We might want to space out the message processing. Say for example you are sendig the messages to a Thrid party service for processing and dont want to DDOS the service by sending too may messages at a point of time, but space out the messages getting sent.
When processing messages where we are setting a delay remember to set the Visibility timeout of the Queue to a large enough value . If the visibility timeout is very short for example say 30 seconds and you have put a delay of 1 minute for your message. The message will never be picked up by the consumer and get lost.