In Google Cloud, I am having an IoT Core Registry with a number of devices (connected over MQTT) and 2 Pub/Sub topics: events topic (for device telemetry events) and state topic (for device state events). I am processing messages from the events topic with a Dataflow job.
Question: how do I know which device the given message is coming from? Do I need to manually enrich the message (on the device side) with some kind of device ID, or is it somehow provided by the Google Cloud?
What if I used Cloud Functions instead?
In the end I would like to be able to store the messages in a data store (BigTable, BigQuery...) along with its source device ID.
Thanks!