- 최신
- 최다 투표
- 가장 많은 댓글
Hi there!
Once a message is published to AWS IoT Core, there is no metadata in the message itself. One way to accomplish this is to give each unique thing (and the attached certificate) it's own topic structure to publish. For instance, things Foo
and Bar
could have an IoT policy that allows them to publish on dt/{iot:Connection.Thing.ThingName}/*
, where Connection.Thing.ThingName
must match thignName (see these examples for why this helps with clientId
matching thingName
). Then depending upon what will parse and customize you can extract the MQTT topic. With the example above, Foo
publishes a message on dt/Foo/telemetry
, and any subscribers or the rule engine can then parse the second level of the topic to get the thing name.
If using rules to transform data, use the topic function to obtain the thingName.
Please let me know if this helps!
관련 콘텐츠
- 질문됨 4일 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 3년 전
- AWS 공식업데이트됨 일 년 전
This whitepaper is also useful: https://docs.aws.amazon.com/whitepapers/latest/designing-mqtt-topics-aws-iot-core/mqtt-design-best-practices.html.
Thanks for your helps