Exploring the Vert.x MQTT server project

In the last few years we used Vert.x to prototype and develop several IoT related projects. Most of the projects use MQTT for lightweight messaging between the connected devices (or things ;)) and the applications. The messaging is handled by an external broker liker Mosquitto.

Instead of using an external broker it’s now possible to connect MQTT enabled devices directly to Vert.x using the Vert.x MQTT server project. Although the project is still in Tech Preview we’ll show you how use it to create a MQTT server within Vert.x. Continue reading

Building Vert.x projects using Gradle

We currently use Vert.x in several internal and external projects. Until the most recent project we where building our Vert.x modules using Maven.

Gradle is our build tool of choice, but the default approach described at the Vert.x site caused several issues:

  • The task of cloning, cleaning and configuring the template project is error-prone;
  • The template project does not support recent Gradle versions >= 2.x;
  • This approach is not compatible with the Gradle support in IntelliJ IDEA.

While starting our most recent project we investigated the possibility of using Gradle again. Instead of using the approach described at the Vert.x site we are using the excellent Vert.x Gradle plugin provided by Daryl Teo.

Using the following Gradle build file we are able to build and run our project from Gradle and import it successfully into IntelliJ IDEA:

Using this configuration exposes the following Vert.x related Gradle tasks:

  • modZip : Creates the module zip
  • debugMod : Run the module including remote debugging
  • runMod : Run the module

More information regarding this marvellous Gradle Vert.x plugin can be found at:
https://github.com/darylteo/vertx-gradle-plugin.

Note that the credits for the Vert.x Gradle plugin fully go to Daryl Teo. This post is only meant to raise the awareness of the existence of the plugin and to complement him for his great work.

 

.