Meross IOT and Mqtt3SubAckException by the Java Client Library

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 tecnology. I went with MQTT 3 as I have no clues about MQTTT 5 support by the Meross broker.
As far as the HTTP part everything is working ok, i.e. It is possible to retrieve the cloud credentials and the devList as well. I have chosen HiveMQ to implement the MQTT functionality. as is it is relaiable and encloses many features. The MQTT 3 implementation returns a connAck of “SUCCESS” and TLS handshaking performs correctly too but when subscribing to the topic filter the suback returns the following exception:” com.hivemq.client.mqtt.mqtt3.exceptions.Mqtt3SubAckException: SUBACK contains only Error Codes”
Here is other Himemq relevant log information:
18:36:10.424 DEBUG [vemq.client.mqtt-1-1] [o.netty.handler.ssl.SslHandler:1930 ] - [id: 0xb5028347, L:/168.192.1.154:54210 - R:mqtt-eu-5.meross.com/34.251.5.126:443] HANDSHAKEN: protocol:TLSv1.2 cipher suite:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
18:36:10.537 DEBUG [main] [munication.MerossMqttConnector:72 ] - published message: MqttPublish{topic=/appliance/2306066404030351200248e1e9c96ff1/subscribe, payload=44byte, qos=AT_LEAST_ONCE, retain=false}
18:36:10.538 DEBUG [main ] [munication.MerossMqttConnector:73 ] - connAck: MqttConnAck{returnCode=SUCCESS, sessionPresent=false}

Based on what I’ve read on HiveMQ docs this kind of error might be related to the topic subscription phase so I checked whether the topicfilter and the topic are correctly formed:

18:47:27.049 INFO [main ] [TestMerossMqttConnector :18 ] - Response Topic:/app/3807527-06df42eed27d14714ab47739fb2d7730/subscribe
18:47:27.066 INFO [main ] [TestMerossMqttConnector :25 ] - Publish Topic:/appliance/2306066404030351200248e1e9c96ff1/subscribe

They apperars to be correctly formed according to the documentation I have got, but I suspect of the publish topic.
How can I investigate on this exception?
How could I find out if the broker supports MQTT5 protocol?
Any suggestion is appreciated, thanks in advance.

P.S. Here is the repo:

Hi @fabgio,

A warm welcome to the HiveMQ Community! We’re thrilled to have you here and appreciate your interest in MQTT.

Regarding the issue you’re facing, the exception you’re seeing indicates that your client failed to subscribe to the topic. This exception is thrown by the client library at the following line of code:

There are a few common reasons why a SUBSCRIBE request might fail:

  1. Permission Issues: The client might not have the necessary permissions to subscribe to the topic.
  2. QoS Mismatch: The client has permission to subscribe to the topic, but only with a different QoS level.

To check the client’s permissions, you should review the broker’s configuration since access control is managed on the broker side.

If you’re unsure whether your broker supports MQTT5 or only supports MQTT3, you can use an MQTT client that supports MQTT5 to test any MQTT5 feature not available in MQTT3. For instance, you can use the MQTT-CLI command-line client and run the following command:

mqtt test --host MYBROKERHOST --port MYBROKERPORT --secure --user MYUSER --password MYPASSWORD --mqttVersion 5

This will help you determine if your broker supports MQTT5.

How to download, install and use the MQTT-CLI command-line client: Home - MQTT CLI

If you have any more questions or need further assistance, feel free to ask. We’re here to help!

Best regards,
Dasha from the HiveMQ Team