eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.14k stars 887 forks source link

Stack Overflow on v5 subscribe() #907

Open aaron-613 opened 2 years ago

aaron-613 commented 2 years ago

Hi there,

Just trying out the v5 client for the first time. Ran into a stack overflow bug almost immediately. It's on line 525 of MqttClient:

    public IMqttToken subscribe(String[] topicFilters, int[] qos, IMqttMessageListener[] messageListeners)
            throws MqttException {
        return this.subscribe(topicFilters, qos, messageListeners);
    }

Thanks.

JanEbbinge commented 2 years ago

I think this caused because this function calls itself. And therefor gets in an infinite recursive loop. I worked around it, by using the subscribe function on line 528.

JanEbbinge commented 2 years ago

Looks like a fix is already in pull request. https://github.com/eclipse/paho.mqtt.java/pull/899

shurkanTwo commented 2 years ago

When will this bug going to be fixed? We are facing this issue and therefore can not use the paho mqtt v5 client.