如何在云调度程序中使用发布/订阅消息属性

问题描述 投票:0回答:1

我正在尝试使用谷歌云调度程序来安排工作。根据文档,我们可以将有效负载发布到pub / sub,但是有没有办法发送消息属性?

google-cloud-platform google-cloud-scheduler
1个回答
0
投票

您可以使用gcloud beta命令行工具来设置属性:

https://cloud.google.com/sdk/gcloud/reference/beta/scheduler/jobs/create/pubsub

gcloud beta scheduler jobs create pubsub <JOB> --schedule "0 9 1 * *" --topic <TOPIC> --message-body "test" --attributes key1=value1,key2,value2
© www.soinside.com 2019 - 2024. All rights reserved.