SQS消息延迟无法按预期工作 [英] SQS Message Delay Not Working As Expected
问题描述
我正在尝试延迟发送单个SQS消息.使用 https://docs.aws .amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-send-message-with-timer.html 来测试消息延迟,我看不到任何延迟.
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.
如果我在队列上设置了延迟,则该延迟将被兑现,但是对于单个消息则不会.我正在执行以下操作(全部在AWS控制台中进行):
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):
- 打开SQS控制台,右键单击我的测试队列-确认队列的延迟值为0.
- 右键单击测试队列,然后单击发送消息"
- 添加邮件正文
- 将此邮件的延迟发送时间"设置为30秒
- 点击发送消息.
- 收到确认消息,说明您的消息已发送,将在30秒内准备好接收."
但是,当我检查CloudWatch时,我可以看到消息几乎是立即发送的.我是误解了什么,还是错过了配置中的某些内容?
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?
推荐答案
我的测试显示,发送到Lambda函数用作触发器的SQS队列的消息将立即触发Lambda函数,即使提供了延迟"设置.
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.
请参阅: amazon sqs-如何从lambda触发器将消息返回给SQS-堆栈溢出
这篇关于SQS消息延迟无法按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!