9

I'm just looking into the details of Eclipse PAHO and Mosquitto client libraries (MQTT C++ libraries). It looks like the PAHO uses the mosquitto MQTT broker but provides its own MQTT client libraries.

Also the Mosquitto library provides a way to implement client libraries for Mosquitto MQTT broker.

I would like to understand what's the main difference between these two client libraries. Here it is discussed but that does not answer my question. Which is preferred over another and why? and why eclipse supports both?

Panch
  • 1,097
  • 3
  • 12
  • 43

2 Answers2

5

I'm facing the same issue, whether to pick paho or Mosquitto c++ client library for an embedded linux device. I tried first a minimal application with PAHO. It basically supports all the features I need, but the cpp-library-wrapper does not and I feel like the main project branch paho.mqtt.cpp is not maintained very well. Since there are two features

  1. encryption

  2. set all connect options like mqtt-version, etc

which are not offered through the mainBranch cpp-lib in PAHO, I'm going to use libmosquitto with libmosquittopp wrapper now. So as you see my decision is related to the cpp-library only. But like you I'm still interested to get to know what are the differences between the underlying C-libraries.

florgeng
  • 856
  • 1
  • 9
  • 17
  • Thanks for the info. Earlier I tried with `libmosquitto` and it worked well and pretty easy implement clients with the library. However I wanted to try the `paho` thus I wanted to know the core difference as the both libraries are supported by eclipse. I'll keep posted here if I come across any better information on it. I request you also to do that if feasible. – Panch Mar 30 '17 at 01:39
  • @Panch Did you find any more information on this subject? – Vincent Beltman Aug 23 '19 at 08:49
  • No @VincentBeltman. I did move on with `Mosquitto` client library. – Panch Aug 28 '19 at 06:29
2

We have used Paho C library and Java library. If you look at the Paho C code, the code quality is poor. With the Java library, we experienced a problem where Linux deletes a temp file and Paho does not recover - don't know if that affects the C version. Trying libmosquitto for next project.

Anthony Hayward
  • 2,164
  • 21
  • 17
  • We are a java shop planning to use Paho for MQTT. Can you elaborate on the issue with the Java library?. Was this confirmed as a bug by the dev team? – NishM Jun 30 '17 at 21:24
  • 2
    @NishM I might have some of the details wrong, but as I understand it, the first time the Paho library receives a message from the broker, it creates a temp folder and file. Possibly because of our configuration of Paho, this was being created in /var/tmp. After the application had been running for about 30 days, Linux deleted the folder and the file as part of its housekeeping of this directory, and Paho was broken until the application was restarted. The solution was to tell Paho to create it somewhere else. – Anthony Hayward Jul 03 '17 at 09:51