Connecting HiveMQ Edge To Hive MQ Enterprise on same PC

Trying to wrap my head around how this stuff works, and running into some issues. I started with getting HiveMQ Edge communicating with HiveMQ cloud, and was able to get my simulator talking after some troubleshooting and typos. Now I am trying to get Edge to talk to an instance of enterprise, both running on my local PC.

To start Hive Edge, I ran the following command: sudo docker run --name hivemq-edge -d -p 1883:1883 -p 8080:8080 hivemq/hivemq-edge

For enterprise: sudo docker run -p 443:8080 -p 1884:1883 hivemq/hivemq4:latest

Notice I put 8080 on 443, and 1883 on 1884 since edge is running on the same machine, and using those ports.

For the bridge config, I tried entering localhost, as well as 127.0.0.1, but neither connects using port 1884 (Which I believe should be going to port 1883 of the container). For the username and password, I enter the defaults admin/hivemq as I haven’t changed this.

I feel like there is a fundamental piece of the puzzle I am not understanding. Anyone got ideas, or where I should try looking?

I figured it out.

Since HiveMQ is running in containers, localhost is local to the container, so when I configured the instance of edge to bridge to localhost, it was local to that container, not the PC. To remedy this, I found the IP address of the container running HiveMQ with
docker inspect <container name>| grep "IPAddress"
From there it was as simple as entering that IP into the bridge configuration.

Hello Anthony,

​Glad to see you resolved your issue, and figured out why the connection wasn’t occurring.

In addition to IP address, you can also use “host.docker.internal”.
Utilizing this host resolves localhost services where Docker resides (ie. your PC), and not the localhost services of the Docker container.

Regards,
Gil

1 Like