...
End-to-end testing of mqtt clients
Find the MQTTListenerURL or IP using the following command (hivemq-hivemq-mqtt in our case with IP 20.113.42.183)
Code Block kubectl get services --namespace hivemq
Subscribe a mqtt client: (update url/ip for host, taken from last step, localhost in case of port forward)
Code Block language bash mqtt subscribe -h $mqttHost20.113.42.183 -p $mqttPort1883 -t '#' -q 1 -u mqtt-user-1 -pw mqtt-password-1
Do not close this terminal session. This will allow you to see the results.
From a different terminal session, publish a message to the topic “test”: (update url/ip for host, taken from last step, localhost in case of port forward)
Code Block language bash mqtt publish -h $mqttHost20.113.42.183 -p $mqttPort1883 -t topic-1 -m Hello -q 1 -u mqtt-user-2 -pw mqtt-password-2
If everything is correct, the subscriber will receive the message:
Code Block language bash mqtt subscribe -h $mqttHost -p $mqttPort -t '#' -q 1 -u mqtt-user-1 -pw mqtt-password-1
Code Block language bash Hello
...