How to connect to open source emqx broker and build his own broker?

898 Views Asked by At

Protocol: mqtt
Version: 3.1.1
Gateway model: CloudGate Ethernet CG0102

I'm publishing json message from my gateway which is connected to an open source Emqx broker (broker.emqx.io) port 1883 for a test. I tried to consume the messages by connecting to it with MQTTX by giving the following informations: Name, Client_ID, Host, Port, Username and Password, and then giving my topic which is my_topic.

The problem is nothing appear in my MQTTX while the given broker informations are good and similar to those in my gateway. Why ?

Also I would like in the future to use my own mqtt broker mounted on my laptop ? Any simple references where I could start to make such thing ? I already use mqtt to consume messages with python from remote broker but never try to build one to receive messages from my remote gateway.

I'm working on a ubuntu bionic VM

1

There are 1 best solutions below

8
On

Client_ID needs to be unique for every client, so you can not reuse Client_ID between clients.

The MQTT spec says that the broker should kick the oldest client off when a new client connects with the same Client_ID. This normally leads to a fight between the 2 clients as they both try and reconnect kicking each other off.