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.
-
For a HiveMQ Enterprise MQTT Broker, confirm a successful deployment. For instructions, see Confirm that your HiveMQ broker runs.
-
For a HiveMQ Cloud Broker, confirm a successful deployment. For instructions, see Confirm that your HiveMQ Cloud Broker runs.
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:
-
HiveMQ Broker: Use the MQTT CLI to connect your HiveMQ Broker to local clients. For specific instructions, see Connect MQTT Clients to Your HiveMQ Broker.
-
HiveMQ Cloud Broker: Use the Test Connection user interface in the platform to connect your HiveMQ Cloud broker to a WebClient. For specific instructions, see Verify a HiveMQ Cloud Broker-WebClient Connection.
| 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:
-
HiveMQ Broker: Use the MQTT CLI. For specific instructions, see Publish an MQTT Message / Subscribe to an MQTT Topic.
-
HiveMQ Cloud Broker: Use the platform, its built-in WebClient, and the default port. For specific instructions, see Validate Message Transfer for a HiveMQ Cloud Broker.
-
HiveMQ Cloud Broker (alternate method): Optionally, you can use the MQTT CLI to validate message transfer. For specific instructions, see Test Pub/Sub with the MQTT CLI.
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.