Consuming device data
When a device publishes telemetry and state events to Cloud IoT Core, those events are propagated to Cloud Pub/Sub topics associated with the device registry. In previous examples, we configured the weather-sensors device registry to push telemetry events to the weather-telemetry topic and device state events to the weather-device-state topic. As covered earlier in this chapter, Cloud Pub/Sub queues messages based on subscriptions. When a Pub/Sub topic has no subscriptions, any messages published to that topic will simply be dropped.
Because device events are pushed to Cloud Pub/Sub topics, any service that can consume Pub/Sub messages is capable of receiving device events. Google Cloud Functions are a good candidate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access