Cloud based brokers are likely to become very popular in the future for organisations they operate over a wide geographic area.
CloudMQTT like Amazon,Azure etc provide a managed cloud based mosquitto broker.
The plans on CloudMQTT are shared plans which means that several MQTT brokers run on the same hardware.
The brokers are distinguished by the port numbers as shown in the diagram below..
To create a new broker instance click on the create instance button.
enter the name, select the plan and also the data center then click create new instance.
The instance will be created and you can see the details by clicking on instance name.
Here are the details for one of my brokers. You will need the server name port numbers etc for configuring your clients.
You can also manage users ,view logs and configure bridges from this panel as shown below.
Connecting to your Broker Using Python
Below I’ve shown the relevant bits of code from my script. The important thing to note is the call to the username_pw_set function. (Note: the password and username has been change for security)
broker="m21.cloudmqtt.com" port=17363 username="toyeerbnp" username="steve1e" password="JUlkU47AEy86o" client.username_pw_set(username, password) client = mqtt.Client("Python1",clean_session=CLEAN_SESSION) client.connect(broker,port)
Common Questions and Answers
Q- Can I configure topic restrictions?
A- Yes -Under Users and ACL
Q- Do All client connections require a username/password?
Note: If you want to run multiple brokers on your own hardware then take a look at this video –How to run multiple mosquitto brokers on the same host.