paho.mqtt.python icon indicating copy to clipboard operation
paho.mqtt.python copied to clipboard

Response Topic Support

Open mike-sandstrom opened this issue 4 years ago • 1 comments

Hello,

When running dir(message) after receiving a message in an mqtt client, I can see properties is one of the options returned. When running dir(message.properties) i receive AttributeError: properties. I am trying to implement a response Topic from the sending client--which uses the mqtt.js library in the browser. I havent seen much in terms of documentation on this aside from http://www.steves-internet-guide.com/mqttv5-request-response/, he has a link to download code that demonstrates a responseTopic implementation. Any info on this will be appreciated, if there is no support for this what are the next steps to take to achieve this feature?

mike-sandstrom avatar Apr 17 '21 23:04 mike-sandstrom

message.properties isn't set for MQTT v3.1.1 or earlier connections. I would suggest setting protocol=5 in your client creation call, i.e. client = paho.Client(protocol=5, ...).

There is an example that uses response topics here: https://github.com/eclipse/paho.mqtt.python/blob/master/examples/server_rpc_math.py

ralight avatar Jul 21 '21 23:07 ralight

Closing this as it's been flagged completed for a few years.

MattBrittan avatar Jan 07 '24 02:01 MattBrittan