# HiveMQ Client Library

**URL:** https://community.hivemq.com/c/hivemq-client-library/7.md

[Latest](https://community.hivemq.com/latest.md) · [Categories](https://community.hivemq.com/categories.md)

---

## [About the HiveMQ Client Library category](https://community.hivemq.com/t/about-the-hivemq-client-library-category/23)

<div class="topic-metadata">

**Author:** [@hivemq-support](https://community.hivemq.com/u/hivemq-support)\
**Replies:** 0

</div>

This category provides a space for all discussion and questions regarding the HiveMQ MQTT Client Library.

---

## [Exception while decoding PUBACK: fixed header flags must be 0 but were 8](https://community.hivemq.com/t/exception-while-decoding-puback-fixed-header-flags-must-be-0-but-were-8/4016)

<div class="topic-metadata">

**Author:** [@Boris](https://community.hivemq.com/u/Boris)\
**Replies:** 2\
**Last updated:** [April 14, 2026, 4:00pm UTC](https://community.hivemq.com/t/exception-while-decoding-puback-fixed-header-flags-must-be-0-but-were-8/4016 "2026-04-14T16:00:55Z")

</div>

Hi, The server runs on wss.certigo.com:443 I can connect to this server using org.eclipse.paho.client.mqttv3.MqttClient I want to migrate to hivemq client library. I receive this log when connect to the server wss.c…

---

## [Message ordering guarantees in a cluster of brokers at failover](https://community.hivemq.com/t/message-ordering-guarantees-in-a-cluster-of-brokers-at-failover/4014)

<div class="topic-metadata">

**Author:** [@venhufezu](https://community.hivemq.com/u/venhufezu)\
**Replies:** 1\
**Last updated:** [April 10, 2026, 2:06pm UTC](https://community.hivemq.com/t/message-ordering-guarantees-in-a-cluster-of-brokers-at-failover/4014 "2026-04-10T14:06:56Z")

</div>

Hello, We are having a cluster of HiveMQ brokers with a load balancer in front of it and replica count \> 1. Our clients are using QoS 1 and persistent sessions. For one topic we need ordering guaranties. We have one pu…

---

## [How to force an immediate connection attempt on Android?](https://community.hivemq.com/t/how-to-force-an-immediate-connection-attempt-on-android/4000)

<div class="topic-metadata">

**Author:** [@eehouse](https://community.hivemq.com/u/eehouse)\
**Replies:** 1\
**Last updated:** [April 8, 2026, 10:30am UTC](https://community.hivemq.com/t/how-to-force-an-immediate-connection-attempt-on-android/4000 "2026-04-08T10:30:49Z")

</div>

"I am using hivemq-mqtt-client:1.3.12 on Android (for a turn-based game.) When the OS blocks the connection (e.g., background restrictions), the client enters DISCONNECTED\_RECONNECT. My issue is that when the user bring…

---

## [Problems with hivemq in the background on Android](https://community.hivemq.com/t/problems-with-hivemq-in-the-background-on-android/3992)

<div class="topic-metadata">

**Author:** [@erik\_bby](https://community.hivemq.com/u/erik_bby)\
**Replies:** 2\
**Last updated:** [March 18, 2026, 9:17pm UTC](https://community.hivemq.com/t/problems-with-hivemq-in-the-background-on-android/3992 "2026-03-18T21:17:53Z")

</div>

We’ve had problems with running the hivemq client in the background on android in a foreground service. Our service is running as a location foreground service, and it reliably wakes up and does stuff when we get a locat…

---

## [Overlapping subcriptions trigger exponentially on flowables](https://community.hivemq.com/t/overlapping-subcriptions-trigger-exponentially-on-flowables/3995)

<div class="topic-metadata">

**Author:** [@splitframe](https://community.hivemq.com/u/splitframe)\
**Replies:** 2\
**Last updated:** [February 5, 2026, 2:42pm UTC](https://community.hivemq.com/t/overlapping-subcriptions-trigger-exponentially-on-flowables/3995 "2026-02-05T14:42:10Z")

</div>

Edit: At first I assumed the wildcard subscription was shadowing the specific one, with further testing and a test project I noticed that the shadowing was actually just the specific messages arriving late, there is anot…

---

## [Client support for SNI](https://community.hivemq.com/t/client-support-for-sni/3926)

<div class="topic-metadata">

**Author:** [@maratusa](https://community.hivemq.com/u/maratusa)\
**Replies:** 1\
**Last updated:** [September 12, 2025, 11:45am UTC](https://community.hivemq.com/t/client-support-for-sni/3926 "2025-09-12T11:45:44Z")

</div>

Hi, I am trying to implement an MQTT client using HiveMQ Client java. This client connects to a MQTT broker (fqdn: broker.server.com) through a proxy (IP 40.40.40.40). I will need to specify the SNI for the SSL handsha…

---

## [Getting Mqtt5DisconnectException exception](https://community.hivemq.com/t/getting-mqtt5disconnectexception-exception/3783)

<div class="topic-metadata">

**Author:** [@Aashima](https://community.hivemq.com/u/Aashima)\
**Replies:** 1\
**Last updated:** [May 23, 2025, 12:56pm UTC](https://community.hivemq.com/t/getting-mqtt5disconnectexception-exception/3783 "2025-05-23T12:56:03Z")

</div>

com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5DisconnectException: QoS 2 PUBLISH must not be resent during the same connection. fun publishToTopic(publishListener: WsMqttPublishListener, topic: String, payload: ByteArray…

---

## [Getting connection failed exception](https://community.hivemq.com/t/getting-connection-failed-exception/3753)

<div class="topic-metadata">

**Author:** [@Aashima](https://community.hivemq.com/u/Aashima)\
**Replies:** 2\
**Last updated:** [May 23, 2025, 12:25pm UTC](https://community.hivemq.com/t/getting-connection-failed-exception/3753 "2025-05-23T12:25:35Z")

</div>

I am handling the exception on addDisconnectedListener and on connection fail just logging internal log but what is exact reason for failure. I am getting this cast exception but i am not doing any casting just logging t…

---

## [HiveMQ Client as a native Ignition module](https://community.hivemq.com/t/hivemq-client-as-a-native-ignition-module/3771)

<div class="topic-metadata">

**Author:** [@system24seven](https://community.hivemq.com/u/system24seven)\
**Replies:** 1\
**Last updated:** [May 14, 2025, 7:42am UTC](https://community.hivemq.com/t/hivemq-client-as-a-native-ignition-module/3771 "2025-05-14T07:42:59Z")

</div>

In case it is helpful to anyone, I have been developing a free MQTT client module for Inductive Automation’s Ignition platform based on the HiveMQ client libraries. It is relatively early development, but already it is a…

---

## [Use the HiveMQ Mqtt client without certificate validation?](https://community.hivemq.com/t/use-the-hivemq-mqtt-client-without-certificate-validation/3734)

<div class="topic-metadata">

**Author:** [@cdutz](https://community.hivemq.com/u/cdutz)\
**Replies:** 2\
**Last updated:** [April 22, 2025, 6:15am UTC](https://community.hivemq.com/t/use-the-hivemq-mqtt-client-without-certificate-validation/3734 "2025-04-22T06:15:59Z")

</div>

I am currently just doing some research on MQTT usage in a demo environment. As the certificates seem to keep on changing almost on a daily basis, I would love to simply accept all certificates until it’s time to move t…

---

## [Connection failed : Attempting MQTT connection...failed, rc=-4](https://community.hivemq.com/t/connection-failed-attempting-mqtt-connection-failed-rc-4/3732)

<div class="topic-metadata">

**Author:** [@Changdae](https://community.hivemq.com/u/Changdae)\
**Replies:** 1\
**Last updated:** [April 22, 2025, 3:33am UTC](https://community.hivemq.com/t/connection-failed-attempting-mqtt-connection-failed-rc-4/3732 "2025-04-22T03:33:01Z")

</div>

Hello, HIVEMQ SUPPORT FORUM I’m currently working on a project using an ESP32-Dev-MINI-1 and trying to connect to a HiveMQ Cloud broker, but I’m running into an issue where the MQTT connection keeps timing out. ❖ Probl…

---

## [Is there an updated client for VB6 (COM/OCX-type) that I can use with the HiveMQ broker?](https://community.hivemq.com/t/is-there-an-updated-client-for-vb6-com-ocx-type-that-i-can-use-with-the-hivemq-broker/3692)

<div class="topic-metadata">

**Author:** [@lfeche](https://community.hivemq.com/u/lfeche)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 12:54pm UTC](https://community.hivemq.com/t/is-there-an-updated-client-for-vb6-com-ocx-type-that-i-can-use-with-the-hivemq-broker/3692 "2025-04-11T12:54:59Z")

</div>

Hello! I’m working on updating a project that requires connecting a process from a VB6-based system to the Node-RED or Flowfuse platform. This is also motivated by the upcoming first stable release of TwinBasic (https:/…

---

## [Connect MQTT broker with pre-signed url](https://community.hivemq.com/t/connect-mqtt-broker-with-pre-signed-url/751)

<div class="topic-metadata">

**Author:** [@Dooyoung](https://community.hivemq.com/u/Dooyoung)\
**Replies:** 21\
**Last updated:** [April 8, 2025, 6:00pm UTC](https://community.hivemq.com/t/connect-mqtt-broker-with-pre-signed-url/751 "2025-04-08T18:00:36Z")

</div>

Hi, I’m having trouble with connecting mqtt broker with pre-signed url which looks like : wss://…eu-central-1.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=…&X-Amz-Date=20211004T170341Z&X-Amz-Sig…

---

## [HiveMQ Android Lib with AWS IoT](https://community.hivemq.com/t/hivemq-android-lib-with-aws-iot/271)

<div class="topic-metadata">

**Author:** [@solano](https://community.hivemq.com/u/solano)\
**Replies:** 5\
**Last updated:** [March 28, 2025, 10:26am UTC](https://community.hivemq.com/t/hivemq-android-lib-with-aws-iot/271 "2025-03-28T10:26:30Z")

</div>

Hello guys, can i use the hivemq android client to connect with AWS IoT Server ? or, is there a restriction to use it and needs to use amazon sdk for android? Best Virgilio Magalhaes.

---

## [$share subscriptions and C# client per subscription callback](https://community.hivemq.com/t/share-subscriptions-and-c-client-per-subscription-callback/3322)

<div class="topic-metadata">

**Author:** [@tkuznia](https://community.hivemq.com/u/tkuznia)\
**Replies:** 1\
**Last updated:** [March 3, 2025, 6:03pm UTC](https://community.hivemq.com/t/share-subscriptions-and-c-client-per-subscription-callback/3322 "2025-03-03T18:03:34Z")

</div>

$share/group/topic/item topic/item The $share topic doesn’t fire an event when configured via SubscribeOptionsBuilder.WithSubscription, but the non-$share one does. The $share topic DOES fire a client.OnMessageReceive…

---

## [Not able to connect Mqtt Broker through proxy](https://community.hivemq.com/t/not-able-to-connect-mqtt-broker-through-proxy/3489)

<div class="topic-metadata">

**Author:** [@roshasha](https://community.hivemq.com/u/roshasha)\
**Replies:** 1\
**Last updated:** [March 3, 2025, 5:20pm UTC](https://community.hivemq.com/t/not-able-to-connect-mqtt-broker-through-proxy/3489 "2025-03-03T17:20:26Z")

</div>

I am trying to connect to Mqtt Broker (Ignition broker module) through corporate proxy, I am getting below error while executing client.connect(); call. Mqtt broker is running on my local. I also tried to connect mqtt br…

---

## [In Order over multiple topics](https://community.hivemq.com/t/in-order-over-multiple-topics/3390)

<div class="topic-metadata">

**Author:** [@ounger](https://community.hivemq.com/u/ounger)\
**Replies:** 1\
**Last updated:** [February 19, 2025, 11:02am UTC](https://community.hivemq.com/t/in-order-over-multiple-topics/3390 "2025-02-19T11:02:47Z")

</div>

How to ensure receiving messages from multiple topics in order? Lets say I subscribe to two topics A and B and QoS 2 is given: client.subscribeWith() .topicFilter(“A”) .qos(MqttQos.EXACTLY\_ONCE) .send(); client.sub…

---

## [Client error: io.netty.channel.AbstractChannel$AnnotatedSocketException](https://community.hivemq.com/t/client-error-io-netty-channel-abstractchannel-annotatedsocketexception/3490)

<div class="topic-metadata">

**Author:** [@Rafa](https://community.hivemq.com/u/Rafa)\
**Replies:** 1\
**Last updated:** [January 23, 2025, 2:50pm UTC](https://community.hivemq.com/t/client-error-io-netty-channel-abstractchannel-annotatedsocketexception/3490 "2025-01-23T14:50:01Z")

</div>

Hi, first of all thank you for your support. I get this error, when I tried to connect: Client(message=io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: my-broker.com/\[2709:4800:4100::6…

---

## [How to ensure in-order and lossless with low latency packet delivery from a publisher (mobile client) to a subscriber (web app)?](https://community.hivemq.com/t/how-to-ensure-in-order-and-lossless-with-low-latency-packet-delivery-from-a-publisher-mobile-client-to-a-subscriber-web-app/3403)

<div class="topic-metadata">

**Author:** [@qwert477](https://community.hivemq.com/u/qwert477)\
**Replies:** 1\
**Last updated:** [January 3, 2025, 4:47pm UTC](https://community.hivemq.com/t/how-to-ensure-in-order-and-lossless-with-low-latency-packet-delivery-from-a-publisher-mobile-client-to-a-subscriber-web-app/3403 "2025-01-03T16:47:55Z")

</div>

I’m publishing messages (QoS=1, 1 message/second, 0.6 KB each) from a mobile client to a subscriber web app using MQTT. Each topic will have a single publisher. For a topic, according to the MQTT specification, the brok…

---

## [Issues with Publish from Android: Repeated Packets and Intermittent Publishing Stops Using HiveMQ Client](https://community.hivemq.com/t/issues-with-publish-from-android-repeated-packets-and-intermittent-publishing-stops-using-hivemq-client/3379)

<div class="topic-metadata">

**Author:** [@qwert477](https://community.hivemq.com/u/qwert477)\
**Replies:** 1\
**Last updated:** [December 30, 2024, 6:36pm UTC](https://community.hivemq.com/t/issues-with-publish-from-android-repeated-packets-and-intermittent-publishing-stops-using-hivemq-client/3379 "2024-12-30T18:36:55Z")

</div>

I am developing an Android application that publishes ECG packets using the Java HiveMQ MQTT Client library to a HiveMQ broker. The application works as follows: The user enters a userId(topic), and upon clicking a Star…

---

## [Any Plan To Address Version 1.3.3 Reported Vulnerabilities?](https://community.hivemq.com/t/any-plan-to-address-version-1-3-3-reported-vulnerabilities/3368)

<div class="topic-metadata">

**Author:** [@Helium3](https://community.hivemq.com/u/Helium3)\
**Replies:** 2\
**Last updated:** [December 3, 2024, 3:07pm UTC](https://community.hivemq.com/t/any-plan-to-address-version-1-3-3-reported-vulnerabilities/3368 "2024-12-03T15:07:06Z")

</div>

According to MVN Repository, the most recent version of the client library (1.3.3) was last updated in October 2023. It has three known security vulnerabilities. Is there any plan to address these vulnerabilities and, if…

---

## [Can not connect to broker.hivemq.com : RATE\_EXCEEDED](https://community.hivemq.com/t/can-not-connect-to-broker-hivemq-com-rate-exceeded/3353)

<div class="topic-metadata">

**Author:** [@MichaelJob](https://community.hivemq.com/u/MichaelJob)\
**Replies:** 1\
**Last updated:** [November 20, 2024, 1:27pm UTC](https://community.hivemq.com/t/can-not-connect-to-broker-hivemq-com-rate-exceeded/3353 "2024-11-20T13:27:07Z")

</div>

Hi there, I’m using the free public broker.hivemq.com for my students to do a small chat app in teaching mobile apps with kotlin jetpack compose. Since a few days we encounter: com.hivemq.client.mqtt.mqtt5.exceptions.Mqt…

---

## [\[Android\] Re-subscription issue after reconnection](https://community.hivemq.com/t/android-re-subscription-issue-after-reconnection/3256)

<div class="topic-metadata">

**Author:** [@Rafa](https://community.hivemq.com/u/Rafa)\
**Replies:** 2\
**Last updated:** [October 11, 2024, 9:17am UTC](https://community.hivemq.com/t/android-re-subscription-issue-after-reconnection/3256 "2024-10-11T09:17:52Z")

</div>

Hi, first of all thank you for your support. I have implemented Mqtt in my Android application, and there is an bug/issue when it reconnects. When devices looses internet connection, mqtt gets disconnected. It reconnec…

---

## [Unable To Achieve High Message Throughput](https://community.hivemq.com/t/unable-to-achieve-high-message-throughput/3223)

<div class="topic-metadata">

**Author:** [@Helium3](https://community.hivemq.com/u/Helium3)\
**Replies:** 2\
**Last updated:** [September 30, 2024, 5:51pm UTC](https://community.hivemq.com/t/unable-to-achieve-high-message-throughput/3223 "2024-09-30T17:51:48Z")

</div>

I’m building a system to ingest messages via subscription from an MQTT broker and, in order to test my application, I need to publish messages at volume to the broker. The actual data that I’ll be ingesting is highly str…

---

## [Looking for iOS MQTT Clients with MQTTv5 Support Compatible with HiveMQ](https://community.hivemq.com/t/looking-for-ios-mqtt-clients-with-mqttv5-support-compatible-with-hivemq/3110)

<div class="topic-metadata">

**Author:** [@qwert477](https://community.hivemq.com/u/qwert477)\
**Replies:** 1\
**Last updated:** [August 22, 2024, 8:57am UTC](https://community.hivemq.com/t/looking-for-ios-mqtt-clients-with-mqttv5-support-compatible-with-hivemq/3110 "2024-08-22T08:57:47Z")

</div>

Hi, I’m currently working on a project that involves using HiveMQ as the MQTT broker. I’m specifically looking for iOS MQTT clients that support MQTTv5 and are known to work seamlessly with HiveMQ. If you’ve had succes…

---

## [QoS 1 redelivery behavior](https://community.hivemq.com/t/qos-1-redelivery-behavior/3019)

<div class="topic-metadata">

**Author:** [@dlowreytcna](https://community.hivemq.com/u/dlowreytcna)\
**Replies:** 1\
**Last updated:** [July 29, 2024, 4:45pm UTC](https://community.hivemq.com/t/qos-1-redelivery-behavior/3019 "2024-07-29T16:45:26Z")

</div>

Following What is MQTT Quality of Service blog post, it states that for QoS 1: If the sender doesn’t receive the PUBACK packet within a reasonable time frame, it re-transmits the message to ensure its delivery. Howev…

---

## [Meross IOT and Mqtt3SubAckException by the Java Client Library](https://community.hivemq.com/t/meross-iot-and-mqtt3subackexception-by-the-java-client-library/3025)

<div class="topic-metadata">

**Author:** [@fabgio](https://community.hivemq.com/u/fabgio)\
**Replies:** 1\
**Last updated:** [July 1, 2024, 8:39am UTC](https://community.hivemq.com/t/meross-iot-and-mqtt3subackexception-by-the-java-client-library/3025 "2024-07-01T08:39:21Z")

</div>

Dear HiveMQ community, I am new to MQTT protocol and HiveMQ. For the time being, I have been developing a Java implementation of the Meross IoT library. The Meross broker seems to be based on Amazon AWS MQTT tecnolog…

---

## [Hive MQ “Invalid handshake response getStatus: 426 Upgrade Required” connecting to AWS](https://community.hivemq.com/t/hive-mq-invalid-handshake-response-getstatus-426-upgrade-required-connecting-to-aws/1480)

<div class="topic-metadata">

**Author:** [@JonathanMason](https://community.hivemq.com/u/JonathanMason)\
**Replies:** 2\
**Last updated:** [June 14, 2024, 2:55pm UTC](https://community.hivemq.com/t/hive-mq-invalid-handshake-response-getstatus-426-upgrade-required-connecting-to-aws/1480 "2024-06-14T14:55:47Z")

</div>

I am trying to connect to an AWS MQTT broker/server using the Hive MQ client library for Android Studio (v1.3.0) with an AWS pre-signed URL. implementation("com.hivemq:hivemq-mqtt-client:1.3.0") implementation(platform(…

---

## [Publishes.receive() moves to next message before acknowledge()](https://community.hivemq.com/t/publishes-receive-moves-to-next-message-before-acknowledge/2740)

<div class="topic-metadata">

**Author:** [@jonathan](https://community.hivemq.com/u/jonathan)\
**Replies:** 1\
**Last updated:** [June 14, 2024, 2:47pm UTC](https://community.hivemq.com/t/publishes-receive-moves-to-next-message-before-acknowledge/2740 "2024-06-14T14:47:03Z")

</div>

I have a scenario where I have a persistent session. The topic I have my client subscribed to has received 7 messages while it was offline. My client has now come back online and is trying to process those messages. When…

[Next page](https://community.hivemq.com/c/hivemq-client-library/7.md?page=1)
