在 AWS 中重定向到 SQS 时如何获取 IoT 主题

pix*_*xel 3 amazon-sqs aws-iot

当消息从 AWS IoT 重定向时,有什么方法可以获取 SQS 队列中的主题名称?

cem*_*cks 5

您可以在IOT规则的SELECT语句中使用sql函数topic()。

就像是 SELECT * as data, topic() as topic FROM 'your topic'

IOT sql 函数参考http://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-functions.html#iot-function-topic