MQTT

MQ Telemetry Transport is a publish-subscribe pattern based "light weight" messaging protocol. The protocol is often used in the the IoT, “Internet of Things” world of connected devices. Its designed for built-in systems, mobile phones and other memory and bandwidth sensitive applications.

CloudAMQP do recommend the AMQP protocol in favour of the MQTT protocol.

publish subscribe example

MQTT provide an asynchronous communications protocol, the sender and receiver of the message do not need to interact with the message queue, the topic, at the same time. Messages placed onto the topic are stored until the recipient retrieves them or until the messages times out. MQTT are for good use by bandwidth sensitive applications.

publish subscribe example

MQTT protocol on RabbitMQ

Important note (22/7 2016): We have decided to disable the RabbitMQ MQTT plugin for all instances by default due to a security vulnerability. More information can be found here. We recommend everyone that will be using MQTT to run RabbitMQ 3.5.8 or RabbitMQ 3.6.6, or later, they all include a fix for the security vulnerability in the plugin.

The MQTT plugin is currently available on dedicated plans and the new shared servers in AWS US-East-1, GCE Europe West, GCE US Central and GCE Asia East.

The MQTT plugin has to be enabled on dedicated plans. The plugin can be enabled from the plugin tab. The port used for MQTT is port 1883 (8883 for TLS wrapped MQTT). Use the same default username and password as for amqp. You need to add the vhost to the username when you sign in (the vhost is the same as the username for shared plans): vhost:username

QoS 1 is supported (if you are setting QoS 2 it will be downgraded to QoS 1).

More information about RabbitMQ MQTT can be found here: https://www.rabbitmq.com/mqtt.html#overview

Language specific documentation can be found here: Ruby, Python, NodeJS, Java, GO, .NET, NodeMCU (Lua), PHP.

Example when using mosquitto and TLS on shared instances:

//Subscribe
mosquitto_sub -h hostname -d -t topic -u my_vhost:my_username -P my_password -c -i test1 -q 1 --cafile /usr/local/etc/openssl/cert.pem -p 8883

  //Publish
  mosquitto_pub -h hostname -d -m message -t topic -u my_vhost:my_username -P password

If you have any questions, please feel free to contact support@cloudamqp.com for further assistance.