Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins/event_source/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ async def main(queue: asyncio.Queue, args: Dict[str, Any]) -> None:
await mqtt_consumer.subscribe(topic)
async for message in messages:
try:
data = json.loads(message.payload.decode())
try:
data = json.loads(message.payload.decode())
except json.decoder.JSONDecodeError:
data = dict(payload=message.payload.decode())
await queue.put(data)
except json.decoder.JSONDecodeError:
logger.exception("Decoding exception for incoming message")
Expand Down