Mosquitto - EMQX bridge connection name

473 views Asked by At

1) How to determine the Mosquitto bridge connection name.

The snippet written below is from the EMQx documentation (http://emqtt.io/docs/v2/bridge.html#mosquitto-conf)

connection emqttd
address 127.0.0.1:2883
topic sensor/# out 2

the connection name - emqttd is written on what basis?

2) I have a tcp connection open from EMQX on the host 172.22.25.53 and port 2883. When i try connecting from the same system. It works absolutely fine. But from a different system, I get this error

C:\Program Files\mosquitto>mosquitto.exe -c mosquitto.conf -v
1542182003: mosquitto version 1.5.3 starting
1542182003: Config loaded from mosquitto.conf.
1542182003: Opening ipv6 listen socket on port 1883.
1542182003: Opening ipv4 listen socket on port 1883.
1542182003: Bridge [email protected] doing local SUBSCRIBE on topic BA/#
1542182003: Connecting bridge [email protected] (172.22.25.53:2883)
1542182003: Bridge [email protected] sending CONNECT
1542182003: Error creating bridge: Unknown error.
1542182003: Warning: Unable to connect to bridge [email protected].

My mosquitto.conf file is:

connection emqx
address 172.22.25.53:2883
cleansession false
topic AB/# both 2
1

There are 1 answers

2
hardillb On

The connection name is the value after connection in the configuration file. As described in the bridge section of the mosquitto.conf man page

e.g.

connection foo

Will result in a connection name of foo.

172.22.25.53 is in the reserved range 172.16.0.0 – 172.31.255.255, I'm going to guess you are running emq in a docker container and you are trying to access the container using it's Docker internal IP address. You will need to expose the port on your host machine to be able to access it from a remote machine.