randomsync / robotframework-mqttlibrary

MQTT Keyword Library for Robot Framework
Apache License 2.0
25 stars 30 forks source link

Cannot subscribe to topics with ProtoBuf payloads #31

Open NomadQA opened 8 months ago

NomadQA commented 8 months ago

I cannot subscribe to topics with ProtoBuf payloads as both the _on_message and _on_message_list callbacks within MQTTKeywords.py return the payload decoded to utf-8, with the .decode('utf-8'). With ProtoBuf messages, since they are simply raw bytes which are able to contain bytes that cannot be decoded to utf-8, the decode fails and an error message like the following is received: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x97 in position 63: invalid start byte

Is there any plans to allow ProtoBuf payloads?