As a man fascinated by home automation, I constantly am reading up on the latest technical news when it comes to data integration in my home. MQTT recently was thrown into my radar, and I began researching it to see if it’s capabilities would work in my blooming home automation project. The scenario I had was simple: I have two young children, with two new rooms recently added to my home to accommodate them. Does our current heating/cooling system keep their rooms at an ideal temperature for them to rest comfortably? Or will I horrifically overheat or chill my children due to improper balancing of my HVAC system? I created two small, wireless, Arduino-based XBEE sensors that could report to me the room’s humidity and temperature stats (amongst other things), but needed a system for these two sensors to report to. Enter MQTT and the Mosquitto broker.
MQTT was a solid fit for what I was looking to accomplish. Having experienced RabbitMQ/AMQP over the last three years, I’m a fan of topic-based pub/sub systems. However, AMQP is a bit overkill for sending sensory data so simple as room temperature, and MQTT is perfect for taking over the job. The issue I had was with integration into my other systems: I use Mule ESB as my SOA hub for all my data storage and reporting systems in the house. So, I was saddened to see that, while supporting a plethora of other protocols, MQTT was not yet supported natively or via MuleForge. So I decided to change that, not just for myself, but for others looking to do similar projects as me.
Without further ado, I introduce the MQTT Mule Module v0.1. Let me start by putting up the normal disclaimer: Use this connector at your OWN RISK! While I will do my best to keep it relevant and in solid working order, I’m doing this all on my personal time, which can be lacking when it comes to hobbies. Second disclaimer: I’m not yet well-versed in MQTT, or in the creation process of Mule Modules/Connectors. So, these first couple releases are a learning experience for me, and I apologize if I have veered from good coding convention, or if a feature or two have been overlooked. I’m simply trying to get this connector in the wild so it can begin getting pressure tested by folks like yourself.
So what does v0.1 have? Pretty simply put, it has everything you need to subscribe and publish to a MQTTv3 broker. I’ve tested against Mosquitto servers only, so your mileage may vary. Currently, you can only subscribe to a single topic (no topic filters in this initial release). Also, you can only publish java.lang.String messages to the broker. Retention policies haven’t been exposed to you yet (I’m working on that) and LWT messages are not available.
Sounds pretty thin, doesn’t it? Great news: v0.2 is already in the works. It will expose the abilities that I had left out in the interest of time (such as retain settings exposure and LWT), and will also have a couple added features like payload transformations and population of inbound scope properties during subscribe. It will also contain any bugs found in the initial release, which I expect to be a few.
Documentation currently is being kept here:
Source code is currently hosted here:
Issues can be tracked here:
The module has been tested using the Mule ESB 3.3.0 Community Edition, but has been targeted to work *hopefully* on version 3.2.2. I will continue to test this connector against the Mule instances I have running and update the documentation as I discover issues.
I encourage all of you to test this out and give me constructive feedback. I can’t stress enough how excited I am to be releasing this, but how nerve racking it feels to release something without having a lot of exposure to the coding practices and standards of writing such a plugin. It’s my hope that over the next many months, this module will stabilize and become a reliable connector for folks to use in their personal and professional endeavors.
Thanks for your interest! Please leave comments below or at the Github site.