简体   繁体   English

延迟通过 SNS 发送的 SQS 消息

[英]Delay an SQS message sent via SNS

I'm using the AWS SDK v3 to push a message to SNS which is then subscribed to by an SQS Queue.我正在使用 AWS SDK v3 将消息推送到 SNS,然后由 SQS 队列订阅该消息。

 await snsClient.send(new PublishCommand({
                Message: JSON.stringify(payload),
                TopicArn: process.env[SNS_TOPIC_ARN],
            }));

I want to delay individual messages .我想延迟个别消息 Is this possible if I'm pushing them via SNS or do I have to rework it and push directly to SQS?如果我通过 SNS 推送它们是否可行,或者我是否必须对其进行返工并直接推送到 SQS?

You can only control the delay on individual messages when sending the messages to the Amazon SQS queue directly.当直接将消息发送到 Amazon SQS 队列时,您只能控制单个消息的延迟。

It is not possible to specify this value when sending the message via an Amazon SNS topic to the Amazon SQS queue.通过 Amazon SNS 主题向 Amazon SQS 队列发送消息时,无法指定此值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM