Hive mq client connection lost

198 views Asked by At

after connecting normally to my mqtt broker with ssl confing i keep getting a connection lost the moment i try to subscribe with a message :

fixed header flags must be 0 but were 2

this is in my hive mq android client which works fine with a public broker ( subscription and publishing) , i tried connecting to my ssl broker using a web client and it is also the same (connection successful but connection is lost the moment i subscribe to a topic ) anybody have any idea about it ?

my subscription function :

client.subscribeWith()
                    .topicFilter("topic/test")
                    .qos(MqttQos.AT_LEAST_ONCE)
                    .callback { messageReceived: Mqtt3Publish? ->
                        messageReceived?.let {
                       
                        }
                    }
                    .send()
                    .whenComplete { 
                    }
1

There are 1 answers

0
Aaron Franz On

Joghm!

There are likely a few more details here required for a more in-depth diagnosis. Namely, the specific MQTT client being used on Android (it sounds like this may be the HiveMQ Java client), the broker being utilized, and permission configuration for the credentials created within that broker.

Occasionally, these disconnects can be the result of a permissions error with the credentials utilized for the client connection - i.e., if you are trying to subscribe to /test/topic/1, but don't have permission to.

That said, the 'fixed header' message seems to indicate that the packet that was sent for the subscription did not meet the expected format for MQTT subscriptions, and was rejected as a result. I'd like to see the subscribe request that is being sent for verification as well.

With that in mind, please also feel free to post over on the HiveMQ community forums, or give a browse through for other posts that may offer some insight into HiveMQ! https://community.hivemq.com/

Best, Aaron from the HiveMQ Team