Preface
After setting up the ActiveMQ service and starting it through the article (1) , we need to test the connectivity through the MQTT client.
Download MQTT client
MQTT download address
Download the corresponding client according to your needs.
What I downloaded is dmg, which is the client under Mac.
Configure and use
Open after successful installation of the software.
- Know the interface
- Configure the server
http://Ip address of your PC:8161/admin/ or http://127.0.0.1:8161/admin/ This is the address of the management background.
To view the address of the broker server, you need to open /Users/xxx/activeMq/apache-activemq-5.15.13/bin/macosx/conf/activemq.xml and find the following:
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
Find the port number under the corresponding mqtt. As for 1883, use 127.0.0.1 for IP or your real IP.
Then click connect: the green dot in the upper right corner of the connection is successful, the red dot is failed
-
Issue
qos01 02 03: Provide quality of service for messages
retained: Whether to keep the last message after disconnection in the server -
subscription