We are using Google PubSub for an IoT project in a multi-tenant system
- Each device from the same tenant delivers a 'heartbeat' message every minute.
- Each tenant has its own topic.
- Each device has its own subscription to the topic.
The problem we are having is: when we un-plug a device for a couple of days, and then re-plug it, it starts to receive hundreds of messages (old heartbeats from the other devices) that make the device slow for a few minutes.
The question is:
What do you think is the correct way to work with this?
- one topic per device?
- is there a way to clear the suscription and avoid receiving old messages?
We are open to recommendations.
Thank you!!!