- Newest
- Most votes
- Most comments
Hi!
While I cannot comment on Amazon Q's answer (but will bring up to that team), there is no need to pre-create topics in AWS IoT.
AWS IoT Core utilizes a ephemeral topic namespace per AWS account, and as such, topics don't need to be created per-se. When an MQTT client publishes on any topic such a foo/bar
, the message is delivered to AWS IoT Core, and then delivered to any other MQTT client that is subscribed to that same topic. By default, if there are no subscribers, the message is published and discards (due to no subscribers). Note that there are also reserved topics that can be leveraged to interact with other AWS IoT features through normal MQTT publish/subscribe patterns.
You can use persistent sessions or retained messages if there is the need to publish messages to a topic and later have a subscriber receive them.
I would also suggest reviewing the Designing MQTT Topics for AWS Whitepaper to best utilize designing topics on AWS IoT Core.
Please let us know if this answers your question.
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
How will I integrate an AWS IoT Topic as a target for AWS EventBridge so I will get the Events in AWS IoT Core Topic? I assumed AWS EventBridge will ask for the AWS IoT Core Topic name if I would like to integrate n AWS IoT Topic as a target for AWS EventBridge.
This AWS sample demonstrates how to pipe EventBridge messages to AWS IoT Core.
EventBridge doesn't have MQTT (AWS IoT Core) as a target type, and the same is true for IoT Core to EventBridge. To integrate you can use a Lambda function between the two services. Figure 2 in this blog post shows the relationship in both directions. I'll post a separate AWS Samples example in another comment.