1

I am using mosquitto server for MQTT protocol. Using persistence setting in a configuration file with -c option, I am able to save the data. However the file generated is binary one. How would one be able to read that file?

Is there any specific tool available for that?

Appreciate your views.

Thanks! Amit

1

1 Answer 1

4

Why do you want to read it?

The data is only kept there while messages (QOS1 or QOS2) are in flight to ensure they are not lost in transit while waiting for a response from the subscribed client.

Data may also be kept for clients that are disconnected but have persistent subscriptions (cleanSession=false) until that client reconnects.

If you are looking to persist all messages for later consumption you will have to write a client to subscribe and store this data in a DB of your choosing. One possible option to do this quickly and simply is Node-RED, but there are others and some brokers even have plugins for this e.g. HiveMQ.

If you really want to read it then you will probably have to write your own tool to do this based on the Mosquitto src code

1
  • Thanks. This clarified an important concept for me :). I was being lazy and hoping mosquitto would do it for me.
    – Amit Teli
    Commented Sep 9, 2015 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.