【发布时间】:2015-08-18 19:23:06
【问题描述】:
我正在尝试在同一系统上桥接两个 MQTT 代理,HiveMQ 和 Mosquitto。 HiveMQ 正在端口 1884 上工作,Mosquitto 正在 1883 上运行。但是,当我使用mosquitto_pub 命令在端口1883 上发布到mosquitto 代理时,它不会显示在端口1884 上(使用MQTT.fx 作为客户端订阅端口1884 上的所有主题)
这是我只为mosquitto 代理配置了一个网桥。
当我也配置HiveMQ 时,它只在HiveMQ 命令窗口上显示unable to connect to Bridge1, disconnected 消息。我已经包含了下面的配置。请有人帮忙。
在mosquitto.config 文件中,我在bridges 下完成了以下操作。
connection hivemq
address 127.0.0.1:1884
start_type automatic
clientid clientno1
notifications true
同时,我还编辑了 HiveMQ bridges.xml 文件以供阅读
<?xml version="1.0" encoding="UTF-8"?>
<bridges xsi:noNamespaceSchemaLocation="http://www.hivemq.com/bridges/bridge.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bridge>
<connectionName>Bridge1</connectionName>
<addresses>
<address>
<host>localhost</host>
<port>1883</port>
</address>
</addresses>
<clientId>bridgeClient</clientId>
<topicPatterns>
<topicPattern>
<topic>#</topic>
<qos>1</qos>
<direction>both</direction>
<localPrefix>local/</localPrefix>
<remotePrefix>remote/</remotePrefix>
</topicPattern>
</topicPatterns>
<cleanSession>true</cleanSession>
<idleTimeout>10</idleTimeout>
<notificationsEnabled>true</notificationsEnabled>
<tryPrivate>true</tryPrivate>
</bridge>
显示的图像是当我在另一个系统上尝试相同的过程时。在这里,经纪人被桥接。与我之前所做的比较,唯一的区别是在我的原始系统上没有声明说在 1883 上打开 ipv4 侦听套接字。这是问题吗?
【问题讨论】:
标签: mqtt bridge mosquitto hivemq