(2) MQTT client connection test

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.

  1. Know the interface

Insert picture description here

  1. 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&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;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.
Insert picture description here
Then click connect: the green dot in the upper right corner of the connection is successful, the red dot is failed
Insert picture description here

  1. Issue
    Insert picture description here
    qos01 02 03: Provide quality of service for messages
    retained: Whether to keep the last message after disconnection in the server

  2. subscription
    Insert picture description here

Guess you like

Origin blog.csdn.net/u011148116/article/details/106521202