A practical introduction to the HiveMQ MQTT Client library for Java, covering how to set up the Maven dependency, create both asynchronous and blocking MQTT 5 clients using the fluent builder API, connect to a public broker, subscribe to a topic, publish messages, and verify delivery with an integration test using CountDownLatch and assertions.
Table of contents
1. Introduction2. Project Setup3. Creating the Clients4. Connecting, Subscribing, and Publishing5. Verifying Message Delivery6. ConclusionSort: