The documentation you are viewing is for Dapr v1.7 which is an older version of Dapr. For up-to-date documentation, see the latest version.
publish CLI 命令参考
有关 publish CLI 命令的详细信息
说明
发布 pub-sub 事件。
支持的平台
用法
dapr publish [flags]
参数
| Name | 环境变量 | 默认值 | 说明 |
|---|---|---|---|
--publish-app-id, -i |
代表您要发布的应用程序的 ID | ||
--pubsub, -p |
Pub/sub 组件的名称 | ||
--topic, -t |
待发布的 topic | ||
--data, -d |
JSON 序列化数据字符串(可选) | ||
--data-file, -f |
A file containing the JSON serialized data (optional) | ||
--help, -h |
显示此帮助消息 |
示例
将示例 topic 发布到目标 pubsub
dapr publish --publish-app-id appId --topic sample --pubsub target --data '{"key":"value"}'
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.