How to check the size of the message received from the MQTT broker?

34 views
Skip to first unread message

user2301

unread,
Mar 1, 2018, 8:14:42 AM3/1/18
to MQTT
Hi,

I am using paho.mqtt python client to connect to MQTT broker. Upon receiving the message form the broker, it is stored in database. Before storing the message in the database, I want to check the size of the message. Does the message class has attribute to check the size of the message? like topicpayload for example size attribute?

Thanks

Karl Palsson

unread,
Mar 1, 2018, 9:12:26 AM3/1/18
to mq...@googlegroups.com
You have the payload as a bytearray, and python has native size
operators, there's no need.
signature.html
Reply all
Reply to author
Forward
0 new messages