Paho Javascript Client – Figure out received message’s MQTT topic

When using the Paho Javascript client from MQTT; when a message arrives via client.onMessageArrived(), how can we figure out the message’s topic.

This threw me for a bit as the documentation for the message object doesn’t mention ‘topic’ at all – but it turns out that the topic name is stored in the message.destinationName field! (panic over)

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *