You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client handles subscriptions with a large amount of topic levels gracefully.
Actual behavior
java.lang.StackOverflowError in com.hivemq.client.internal.mqtt.handler.subscribe.MqttSubscriptionHandler.
To Reproduce
Steps
Set up a MQTT broker on localhost.
Run reproducer code.
Reproducer code
public class Main {
public static void main(String[] args) {
final Mqtt5BlockingClient client = MqttClient.builder()
.identifier(UUID.randomUUID().toString())
.serverHost("localhost")
.useMqttVersion5()
.build().toBlocking();
client.connect();
final StringBuilder basis = new StringBuilder("/");
for (int i = 0; i < 16; i++) {
final String string = basis.toString();
System.err.println("Rotation: " + i + " StringSize=" + string.length());
final MqttTopicFilter filter = MqttTopicFilter.of(string);
client.subscribeWith().topicFilter(filter).send();
client.unsubscribeWith().addTopicFilter(filter).send();
basis.append(basis);
}
}
}
Expected behavior
Client handles subscriptions with a large amount of topic levels gracefully.
Actual behavior
java.lang.StackOverflowError
incom.hivemq.client.internal.mqtt.handler.subscribe.MqttSubscriptionHandler
.To Reproduce
Steps
Reproducer code
Details
The text was updated successfully, but these errors were encountered: