SQS Message Delay Not Working As Expected

烂漫一生 提交于 2020-01-30 11:27:07

问题


I'm trying send individual SQS messages with a delay. Using https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-send-message-with-timer.html to test message delays, I'm not seeing any delay.

If I set a delay on the queue, that delay is honoured, however not for individual messages. I'm doing the following (all from the AWS console):

  • Open the SQS console and right click on my test queue - verify that there the delay value for the queue is 0.
  • Right click on the test queue and click 'Send a Message'
  • Add a message body
  • Set 'Delay delivery of this message by' to 30 seconds
  • Click Send Message.
  • Receive a confirmation stating 'Your message has been sent and will be ready to be received in 30 seconds.'

However when I check CloudWatch I can see that the message was delivered almost immediately. I'm I misunderstanding something, or have I missed something in the configuration?


回答1:


My testing shows that messages sent to an SQS queue which a Lambda function is using as a trigger will immediately trigger the Lambda function, even if a Delay setting is provided.

See: amazon sqs - How do I return a message back to SQS from lambda trigger - Stack Overflow



来源:https://stackoverflow.com/questions/58221589/sqs-message-delay-not-working-as-expected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!