⏱️ Reading time: 5 min

Mosquitto has about 11,390 stars and 2,667 forks on GitHub as of November 15, 2026, with the latest push to the repository recorded on November 6 (source). What stands out is what hasn’t changed in recent years: Mosquitto is still an MQTT broker written in C, built to run just as well on a Raspberry Pi as on an industrial messaging server.

📑 En este artículo
  1. What the Mosquitto MQTT broker does
  2. Why it matters if you’re building with IoT or messaging
    1. What this means for you if you manage retained messages in MQTT
  3. What we tested in the sandbox
  4. Mosquitto vs. EMQX and MQTTnet
  5. When Mosquitto is not the right choice
  6. References

What the Mosquitto MQTT broker does

The project implements a server for MQTT protocol versions 5.0, 3.1.1 and 3.1, the lightweight messaging standard that sensors, actuators and IoT gateways use to publish and subscribe to data (source). The repository also ships a client library in C and C++, designed to integrate directly into firmware or a desktop application without depending on an interpreted language.

Alongside the broker come command-line utilities: mosquitto_pub, mosquitto_sub and mosquitto_rr for publishing, subscribing and making request-response style calls, plus mosquitto_ctrl, mosquitto_signal and mosquitto_passwd for administering the broker (source). These are the same tools any developer uses to test a topic from the terminal before writing a single line of production code.

Mosquitto runs the same on a Raspberry Pi as on an industrial messaging server. Foto de Mohammad Rahmani en Unsplash

Why it matters if you’re building with IoT or messaging

Anyone designing the backend for a fleet of sensors, irrigation systems, temperature sensors, or connected vehicles needs to decide what runs the publish/subscribe channel. Mosquitto is the default choice when the requirement is a small, single-binary C broker that’s easy to drop into a container or an embedded device. That changes the conversation compared to brokers designed to scale as a cluster from day one.

What this means for you if you manage retained messages in MQTT

If your backend uses MQTT retained messages to show a device’s last known state on a dashboard, check open issue #1225: Mosquitto still doesn’t attach a timestamp to the retained message (source). The practical consequence is that if you need to know when that last value was set, you have to put the timestamp in your application’s payload or track it client-side, because Mosquitto alone won’t give it to you.

flowchart LR
A["Publisher (IoT sensor)"] -->|"publish topic=temp, retain=true"| B[("Mosquitto broker")]
B -->|"delivers the retained message without a timestamp"| C["New subscriber"]
B -->|"live push"| D["Already connected subscriber"]

What we tested in the sandbox

It took 1,207 s with a peak memory of 35,3 MB. The virtual environment was created like this:

$ python3 -m venv .venv

That step took 1,615 s with a peak of 85,7 MB. Installing dependencies showed the following:

$ .venv/bin/python -m pip install --no-input -r requirements.txt
Collecting paho-mqtt==2.1.0
Collecting psutil==7.2.2
Successfully installed paho-mqtt-2.1.0 psutil-7.2.2
📌 Note: the failure is not a Mosquitto bug. Our sandbox harness tests any repository by trying to import it as a Python module, and Mosquitto is a C project built with cmake or make, not a pip package. The automatic import test does not apply to brokers written in C, something worth keeping in mind if you plan to automate tests for messaging software with the same kind of generic harness.

Overall, the repository weighs 12,4 MB and the working directory ended up at 24,8 MB; the peak memory for the entire run was 85,7 MB, during the creation of the virtual environment.

Cloning and testing a C broker calls for a different approach than a Python package. Foto de Compagnons en Unsplash

Mosquitto vs. EMQX and MQTTnet

Mosquitto shares the GitHub topic ‘broker’ with other messaging projects, but not all of them compete in the same league.

ProjectStars (as of 2026-11-15)What it says about itself
Mosquitto~11,390MQTT 5.0/3.1.1/3.1 broker in C, with a client library and command-line utilities (source)
EMQX~16,916“The most scalable and reliable MQTT broker for AI, IoT, IIoT and connected vehicles” (source)
MQTTnet~5,085High-performance .NET library with an MQTT client and server (broker) (source)

The difference isn’t just popularity. EMQX positions itself around industrial IoT scale and connected vehicles, while MQTTnet solves the case of a .NET application that needs an MQTT client and server without leaving the Microsoft ecosystem. Mosquitto, by contrast, bets on being the small, predictable piece: a C binary that a team can audit in full without depending on an additional runtime.

One clarification about how this comparison was put together: the research also surfaced StockSharp/StockSharp for sharing the ‘broker’ topic on GitHub, but that project is an algorithmic trading platform, not a messaging broker (source). It’s a good reminder that grouping repositories by a shared topic can mix a messaging ‘broker’ with a financial ‘broker’, so it’s worth checking the description before treating a search result as a real alternative.

In a Hacker News discussion about Mosquitto, a user recommended Bevywise MQTTRoute as an alternative for home automation, citing its prebuilt dashboards and integration with Home Assistant and mobile apps. It’s presented as a personal preference for that use case, not an objective measurement.

When Mosquitto is not the right choice

If the problem is scaling to millions of concurrent connections spread across several nodes, it’s worth evaluating something already built for that scenario, like EMQX, instead of hand-building a Mosquitto cluster. If the stack is already .NET and the goal is to avoid mixing a C binary into the deploy, MQTTnet provides a client and server without leaving the same language.

And if the application depends on knowing when a retained value was last updated (not just what it is), Mosquitto still doesn’t solve that out of the box: issue #1225 remains open, and for now the fix is to put that timestamp in the application’s payload.

References

Featured image: Foto de Jackson Sophat en Unsplash

📬 Get new articles by email

We only email about big articles (1-2 a month).

How each article is made (sources, testing and editorial criteria): How we work.

Did it work for you? Got a different error? Say so below: questions get answered and help the next reader.

Leave a comment
Categories: ProgrammingTutorials

El Solitario Editorial

Article prepared by the El Solitario editorial team from cited sources, under the editorial responsibility of Luis Navarro. More details in "How we work".

0 Comments

Leave a Reply

Avatar placeholder

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

You can include code inside <code>…</code> or, for several lines, <pre><code>…</code></pre>.

This site uses Akismet to reduce spam. Learn how your comment data is processed.