Test Client-Broker Communication

After you successfully deploy a broker, confirm that data flows between clients and your broker as expected. First, verify that a client connects successfully to your broker. Next, validate that a client successfully publishes and subscribes to topics routed by the broker. Confirming that your broker communicates with clients further validates your broker deployment by proving that data flows between clients and your broker. Proving that data flows can also help you troubleshoot issues in your network.

Before You Begin

Successfully deploy and run the MQTT broker that you want to test.

Verify Client-Broker Connections

MQTT Brokers use different default port locations to listen for messages from MQTT clients. For example:

  • A HiveMQ broker uses the native MQTT listener on port 1883 by default.

  • A HiveMQ Cloud broker uses a TLS-only WebClient listener on port 8884 by default.

  • Alternatively, a HiveMQ Cloud broker can use the native MQTT listener on port 8883.

To verify that clients connect successfully to a broker, use one of the following topics specific to your broker type and its default listener port:

Verifying client-broker connectivity only confirms a client-broker connection. A successful connection does not fully test communication between clients and a broker.

Validate Message Transfer

To validate that messages transfer between a broker and clients, you can use either the MQTT CLI or the HiveMQ Platform. To validate message transfer, you use a client to subscribe to a topic. Next, you create and send a test message. The broker you connected to that client publishes the test message. You validate that the broker successfully publishes the test message.

To validate message transfer for the following broker types:

Confirmation

Confirming that a broker runs, connects to clients, and then successfully transfers messages proves that your data flows between clients and your broker.

Next Steps

If you have connected your HiveMQ Enterprise MQTT Broker to the HiveMQ Platform, learn about how the HiveMQ Platform helps you work with the data that streams through your broker. For more information, see Discovery.

If you have not connected your HiveMQ broker to the HiveMQ Platform, connect it. For specific instructions, see Connect a HiveMQ Broker to the Platform.

For More Information

To better understand how data flows between MQTT clients and your broker, see Publish/Subscribe Architecture.