M2Mqtt and GnatMQ are dead ? Long life to them !

In the last months a lot of people asked me if the M2Mqtt and GnatMQ projects are dead because there were no commits for a long time.

I can say … no ! They are not absolutely dead !

I was very busy in the last months, starting my new exciting Red Hat career in the messaging and IoT team, but I want to continue to support the projects as lead and main committer. Of course, I’ll be still busy with my new job but my commitment is to continue to improve the libraries, fixing bugs and adding new features. Just remember that I’ll do it in my spare time so I could not be so quick to reply your suggestions; of course your help with useful pull requests will be great !

As you now, today the M2Mqtt client library is under the official Paho GitHub repo and I have finally deleted the repo on my personal GitHub account.

The GnatMQ, based on M2Mqtt, will continue to live where it’s now here.

I’ll do my best to check the issues and the pull requests provided by the community, happy to know that my projects have a lot of followers and there are a lot of professional solutions using them out there !

As always I invite you to share with me your experience using my libraries in order to mention your solution in the “case studies” section of the official web site.

Thanks !



TLS client authentication for M2Mqtt !

Today, the new M2Mqtt version was released !

It has “only one” great improvement … the TLS client authentication support !

Now, you can use a client certificate to authenticate the client itself during the SSL/TLS handshake with the broker. A big IoT platform like the Amazon AWS IoT uses it and for this reason, we support this authentication now !

You can connect your IoT device MQTT based to AWS IoT thanks to the new TLS client authentication feature.

The release is available as source code under the Eclipse Paho project, on GitHub and as binaries on Nuget.

Using me on Windows IoT Core and UWP apps !


Using M2Mqtt on Windows IoT Core ? It’s possible !

The compiled package available on Nuget with latest release include the WinRT version that can be used on Windows 8.1, Windows Phone 8.1 and of course on Windows 10 following the UWP (Universal Windows Platform) model : one application for all platforms from PC to smartphone and IoT.

On Paolo Patierno’s blog you can find a simple walkthrough to use M2Mqtt on a Raspberry Pi 2 with latest release of Windows IoT Core. As Paolo said … it’s a simple marriage !

M2Mqtt and GnatMQ : new home, new version … new features !

M2Mqtt 4.2 and GnatMQ 1.1 … new releases … out !!

The real big changes are related to GnatMQ that supports SSL/TLS connections now !

Now you can instantiate the broker class passing it the server X509 certificate to accept only encrypted connections from clients (SSL 3.0 to TLS 1.2). However, this feature works only on .Net Framework version because WinRT APIs doesn’t support SSL/TLS connections on server side (only on client side).

Due to the shared code between GnatMQ and M2Mqtt, on the client side the above changes mean that now you can select the SSL/TLS protocol version you want to use to connect to an MQTT broker (from SSL 3.0 to TLS 1.2 but, of course, it depends on the framework and for example with .Net Micro Framework you have TLS 1.0 as higher version).

Last but not least, the projects have a new home on GitHub (moved from CodePlex) but remember that M2Mqtt is always part of Eclipse Paho project, the bigger project with all MQTT client implementations in all main different languages !

Of course … both new packages are on Nuget !

In summary …

The M2Mqtt client library is available :

The GnatMQ broker is available :

  • As open source project on GitHub;
  • As compiled assemblies on Nuget;

M2Mqtt in the MQTT Client Library Encyclopedia by HiveMQ


Today … is a good day for M2Mqtt project !

Some weeks ago the HiveMQ team asked me to write an article on M2Mqtt library for their post series “MQTT Client Library Encyclopedia” focused on all the main MQTT protocol implementations on client side. Of course, I accepted to write it and today it’s online at following link.

I hope you’ll enjoy and find it useful to understand better how to use the most famous Microsoft based MQTT client !


GnatMQ out of beta … now it has a first stable release !!


Finally GnatMQ was out of beta and released as stable with it’s first version !

In the last period I received a lot of good feedbacks on GnatMQ by more companies that are using it with good results. For me, it was a very good test on this product so I decided to release it as stable first release on CodePlex but of course on Nuget as “cooked” package that you can add in your project and use as .Net/WinRT based MQTT broker.

One of the great usage of the broker is the XSockets plugin that provides the possibility for each XSockets client to interact with MQTT clients using GnatMQ as broker. It’s a great implementation by XSockets team and especially by Uffe Bjorklund ! Of course it’s open source and available on GitHub.

I hope you enjoy the gnat !


MQTT & Eclipse Paho : new releases for M2Mqtt client and GnatMQ broker !!

Finally the new M2Mqtt 4.1 version is out !

In the last months, my library was under pressure thanks to my friends Olivier Vigliengo (from Adeneo) and Nicolas Besson (Microsoft MVP on Windows Embedded, from Adeneo). They used the MQTT client for their hobbistic projects and stressed it a lot !

After exchanging a lot of emails with log traces, I fixed some bugs and added some improvements to the library :

  • Exposed IsPublished flag in the published event to know if message is published or not due to timeout;
  • Internal changes for event management;
  • Fixed bug on negative timeout;
  • Improved stability on not reliable network;
  • Fixed bug on session management;
  • Added trace on queueing operations;

Of course, all changes had a great impact on the GnatMQ broker project related to M2Mqtt. The MQTT broker is still in Beta but I’d like to release it as Stable : I hope that people using it give me a feedback. It seems that XSocket team is using it to support MQTT in their platform. 🙂

As always you can find M2Mqtt under Eclipse Paho project, CodePlex and Nuget. GnatMQ is available only on CodePlex. Finally, I updated the M2Mqtt4CE (for Windows Embedded Compact 2013 OS) on CodePlex as well.

MQTT OASIS 3.1.1 : official support for M2Mqtt and GnatMQ


After about a month of work, it’s finally time to release the new version of the M2Mqtt library ( and the related GnatMQ broker ( Beta) with the MQTT OASIS 3.1.1 specification support (in addition to some bug fixes).

The changes made to the overall project are the following :

  • Support for old 3.1.0 and new OASIS 3.1.1 specification;
  • MqttMsgDisconnected event is exposed only to the GnatMQ broker to handle DISCONNECT message from a client. ConnectionClosed event was added and it is raised when the connection is closed by the client itself or by the peer. It’s a breaking change, I’m apologize but MqttMsgDisconnected didn’t make sense for client disconnection but only for DISCONNECT message received;
  • Added session management (however without persistence) for supporting for 3.1.1 specification (subscription and enqueued messages with QoS 1 and 2);
  • Keep Alive ping request disabled if keep alive timeout is set to zero;
  • GnatMQ handles “session present” flag that is set into CONNACK message for the client if there is an old session restored. In this way the client knows that the broker has restored his previous session. Of course, this flag is handled by M2Mqtt client;
  • Zero bytes client identifier allowed. In this case the GnatMQ assigns a random client identifier to the client. Of course, in this case the session can’t be managed because the client doesn’t know the client identifier assigned by the broker that can’t recover session after a client reconnection (anonymous MQTT client);
  • Removed 23 characters length on client identifier;
  • Now you can set “inflight queue” size to avoid enqueue other messages to publish if the inflight queue is already full (due to network problems);
  • Improvements on receiving thread with some modification on underlying network channel;
  • On subscription request for a topic, the client can receive an error on SUBACK message because the broker rejects the request (forbidden subscription);

As always, I updated all repositories for my project :

This can be considered a Christmas gift !


M2Mqtt is officially part of the Paho project !

Who knows the MQTT protocol, used in the Internet of Things market, also knows that the reference project for it is Paho of the Eclipse Foundation.


This project provides a lot of client implementations of MQTT in all main programming languages ​​such as C/C++ (for Windows or Linux and for embedded systems), Java (J2SE and Android), JavaScript, Python and Go.

In this large list, until a few days ago, an implementation in C# usable on .Net and WinRT platforms was missing . This gap was filled with my M2Mqtt project that is now officially under Paho umbrella for which I’m officially a committer !


It’s a great honor for me and I could not imagine that after few more than one year (M2Mqtt was born in April 2013), the core members of the Eclipse Foundation and all those who work on the MQTT protocol could ask me to be part of this project . Among them are Benjamin Cabè (IoT Community Evangelist of the Eclipse Foundation), Ian Craggs (Software Engineer at IBM and project lead of Paho), Andy Piper (Developer Advocat Twitter and project lead of Paho), Ian Skerrett (Vice President of Marketing at the Eclipse Foundation). To these people I have to add Nicholas O’Leary (Emerging Technology Specialist at IBM, committers on Paho and father of Node-RED), Roger Light (creator of the mosquitto broker and committers on Paho) and all other Paho committers (Al Stockdill-Mander, Andy Gelme, Dave Locke) who voted unanimously on M2Mqtt.


These are the people who believed that M2Mqtt was worthy of being part of the Paho project adding all those who use the library in their professional or hobbistic projects.

As Microsoft MVP (on Windows Embedded and IoT), I’m very happy that C# and .Net/WinRT platforms, thanks to my M2Mqtt project, are now part of a great open source project like Paho. It means that M2Mqtt could be considered the reference implementation of MQTT on Microsoft platforms.

Of course, all those people who until now have been using CodePlex as a repository will continue to do so (the same goes for Nuget). It will always be aligned with the updates and improvements to the library in the Paho project.