无法重新发布到 AWS IoT 规则中的主题
Failed to republish to topic in AWS IoT Rule
在 AWS IoT Core 中,我设置了一个带有重新发布操作的规则来更新事物的影子(TestThing 的影子)like this
(我为该操作创建了新的 IAM 角色,以防您想知道)
我期待的是当我向 'testthing/message' 发布消息时,应该更新事物的影子,并且不会向 'testthing/error' 发布任何内容。但是当我使用 AWS IoT MQTT 客户端
向 'testthing/message' 发布以下消息时
{
"state":
{
"reported":
{
"Info":"Hello AWS IoT!"
}
}
}
我从 'testthing/error' 得到这个错误:
...
"failedAction": "RepublishAction",
"failedResource": "/things/TestThing/shadow/update",
"errorMessage": "Failed to republish to topic. Received Server error. The error code is 403. Message arrived on: testthing/message, Topic: /things/TestThing/shadow/update"
...
如果我将消息应该重新发布到的主题更改为 'testthing/destination',一切正常,没有错误消息发布到 'testthing/error'。
我错过了什么吗?
$aws/# 是保留主题。
根据 AWS 文档 here:
如果您要重新发布到保留主题,则以 $ 开头的主题改用 $$。
请将$换成$$再试一次!
干杯,
公羊
在 AWS IoT Core 中,我设置了一个带有重新发布操作的规则来更新事物的影子(TestThing 的影子)like this
(我为该操作创建了新的 IAM 角色,以防您想知道)
我期待的是当我向 'testthing/message' 发布消息时,应该更新事物的影子,并且不会向 'testthing/error' 发布任何内容。但是当我使用 AWS IoT MQTT 客户端
向 'testthing/message' 发布以下消息时{
"state":
{
"reported":
{
"Info":"Hello AWS IoT!"
}
}
}
我从 'testthing/error' 得到这个错误:
...
"failedAction": "RepublishAction",
"failedResource": "/things/TestThing/shadow/update",
"errorMessage": "Failed to republish to topic. Received Server error. The error code is 403. Message arrived on: testthing/message, Topic: /things/TestThing/shadow/update"
...
如果我将消息应该重新发布到的主题更改为 'testthing/destination',一切正常,没有错误消息发布到 'testthing/error'。 我错过了什么吗?
$aws/# 是保留主题。
根据 AWS 文档 here:
如果您要重新发布到保留主题,则以 $ 开头的主题改用 $$。
请将$换成$$再试一次!
干杯,
公羊