简体   繁体   English

如何连接开源的 emqx broker,搭建自己的 broker?

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

Protocol: mqtt协议:MQTT
Version: 3.1.1版本:3.1.1
Gateway model: CloudGate Ethernet CG0102网关型号:CloudGate 以太网 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.我正在从连接到开源 Emqx 代理 (broker.emqx.io) 端口 1883 的网关发布 json 消息以进行测试。 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.我尝试通过使用 MQTTX 连接到消息来使用消息,方法是提供以下信息:名称、Client_ID、主机、端口、用户名和密码,然后给出我的主题 my_topic。

The problem is nothing appear in my MQTTX while the given broker informations are good and similar to those in my gateway.问题是我的 MQTTX 中什么都没有出现,而给定的代理信息很好并且与我的网关中的信息相似。 Why ?为什么 ?

Also I would like in the future to use my own mqtt broker mounted on my laptop ?我还想将来使用我自己的安装在笔记本电脑上的 mqtt 代理吗? 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.我已经使用 mqtt 从远程代理使用 python 消费消息,但从未尝试构建一个从我的远程网关接收消息。

I'm working on a ubuntu bionic VM我正在开发一个 ubuntu 仿生虚拟机

Client_ID needs to be unique for every client, so you can not reuse Client_ID between clients. Client_ID 需要对每个客户端都是唯一的,因此您不能在客户端之间重复使用 Client_ID。

The MQTT spec says that the broker should kick the oldest client off when a new client connects with the same Client_ID. MQTT 规范说,当新客户端使用相同的 Client_ID 连接时,代理应该踢掉最旧的客户端。 This normally leads to a fight between the 2 clients as they both try and reconnect kicking each other off.这通常会导致 2 个客户端之间发生争执,因为他们都尝试重新连接并互相踢掉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM