From 32b6350c3581cfb02f2021a5c1381f699d2e2f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Tue, 16 Jun 2020 23:09:14 +0200 Subject: [PATCH] Use shared subscription --- freedcs/telemetry/management/commands/mqtt-to-db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freedcs/telemetry/management/commands/mqtt-to-db.py b/freedcs/telemetry/management/commands/mqtt-to-db.py index 5fd9858..de9e0c7 100644 --- a/freedcs/telemetry/management/commands/mqtt-to-db.py +++ b/freedcs/telemetry/management/commands/mqtt-to-db.py @@ -32,7 +32,8 @@ class Command(BaseCommand): async def mqtt_broker(self): async with Client(MQTT_HOST, port=MQTT_PORT) as client: - await client.subscribe("#") + # use shared subscription for HA/balancing + await client.subscribe("$share/telemetry/#") async with client.unfiltered_messages() as messages: async for message in messages: payload = json.loads(message.payload.decode('utf-8'))