Hi, I am running a rabbitmq mqtt ws local cluster of servers.
When using paho I connect with tcp://127.0.0.1:8085.
RabbitMQ documentation says I should use ws://127.0.0.1:8085/ws.
When connecting with HiveMQ client (in Java) I apply:
.serverHost(“tcp://localhost”)
.serverPort(8085).
Connection is not established. When debugging the transport config I see that serverAddress is:
tcp://localhost/ < unresolved > :8085
thank you for your reply. But it does not work. I guess first problem might be as per rabbit mq docs: RabbitMQ supports MQTT 3.1.1 via a plugin that ships in the core distribution. vs suggested client Mqtt5.
As soon as I employ the MqttWebSocketConfig it does not work:
Hi @michael_w, thank you for your reply. However it does not work. First thing that might make problem is that RabbitMQ currently supports MQTT v 3.1.1. and your suggested client is v5.
I use following code which works (below) - however this comes completely without MqttWebSocketConfig. Can you see any problem with it, please? My RabbitMQ cluster is using MQTT 3.1.1 over WS
if you can connect with the standard TCP then the endpoint you are connecting to is most likely not a WebSocket endpoint. I looked up the RabbitMQ documentation they write a plugin needs to be installed in order that MQTT over WebSocket works. Just to be clear you installed that plugin?
Hi @michael_w , thank you for leading me to fix the issue. Maybe for future reference:
I am using following setup:
The RabbitMq servers are in Docker containers. Obviously I was exposing external:internal ports in a wrong way like this
8085:1883 for mqtt
Correct is:
8085:80 for mqtt_ws aka http/web-mqtt on the picture.
Now everything works. Thank you.