Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to set up MQTT test server


Jun 01, 2021 Article blog


Table of contents


This time a colleague is developing an Internet of Things hardware, which needs to transfer the collected to the customer's MQTT server, but is still in the debugging phase, connecting to the other server test is very inconvenient, so he wanted to build an MQTT test server. Search the web for commonly used MQTT proxy servers and finally decide to adopt ActiveMQ Artemis

Introduction to ActiveMQ

Apache ActiveMQ is a Java message server that supports multiple protocols that can be connected using C C++ Python .Net and more. ActiveMQ official website is currently available for download in 2 versions, ActiveMQ Classic and ActiveMQ Artemis where Artemis is the next generation of high-performance, non-blocking architecture, event-driven messaging systems.

 How to set up MQTT test server1

ActiveMQ Artemis installation

To test the convenience of deploying ActiveMQ Artemis on windows platform, we apache-artemis-2.14.0-bin.zip on the activemq website, currently available in the latest version of 2.14.0 (July 20, 2020)

We'll unzip the downloaded ZIP compression package to D:\apache-artemis-2.14.0-boker To create a broker instance, the instance needs to create a new folder F:\apache-artemis-2.14.0-boker enter D:\apache-artemis-2.14.0-boker\bin directory execution (artemis create D:-apache-artemis-2.14.0-boker) broker a broker instance, and the artemis create command prompts you to enter your account password, just follow the prompts.

After the creation is successful, execute artemis run to launch broker instance. Once the instance has started successfully, we can log into the admin panel using the account password we entered when we created the instance.

 How to set up MQTT test server2

ActiveMQ Artemis configuration

We can modify the default port of MQTT profile location: instance \etc\broker.xml

lt;!-- MQTT Acceptor --& lt; acceptor name "mqtt" tcp://0.0.0.0:1883 We can modify 1883 to the port we need

Modify the management panel WEB port, profile location: install directory s etc/bootstrap.xml <web bind,"localhost:8161" path,""web"> Default port 8161 is modified to the port you want

MQTT client test

We use communication cat debugging software to subscribe to the topic message published by the hardware.

 How to set up MQTT test server3

Colleagues said they could get a simple MQTT client to resolve messages received by subscriptions in real time. Client program, with C#winform is very convenient to write, hand a MQTT client code (using MQTTnet) minutes to do.

 How to set up MQTT test server4

The above is about how to build MQTT test server related to the introduction, I hope to help you.