-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mqttv5PahoMessageDrivenChannelAdapter.addTopic(topic, qos) throws IndexOutOfBoundsException #8873
Comments
The bug is, essentially, in the MQTT Paho Client:
Where that I suggest to raise an issue on their side: https://github.com/eclipse/paho.mqtt.java. Meanwhile we will provide some workaround via calling:
API with
|
Fixes: #8873 The `mqttClient.subscribe()` API does not check if properties are provided and fails on the `subscriptionProperties.getSubscriptionIdentifiers().get(0)` call with an `IndexOutOfBoundsException` * Use another `mqttClient.subscribe()` API in the `Mqttv5PahoMessageDrivenChannelAdapter` where there is not such a check * Ensure that `addTopic(NAME)` works as expected in the `Mqttv5BackToBackTests` **Cherry-pick to `6.2.x` & `6.1.x`** # Conflicts: # spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java
Fixes: #8873 The `mqttClient.subscribe()` API does not check if properties are provided and fails on the `subscriptionProperties.getSubscriptionIdentifiers().get(0)` call with an `IndexOutOfBoundsException` * Use another `mqttClient.subscribe()` API in the `Mqttv5PahoMessageDrivenChannelAdapter` where there is not such a check * Ensure that `addTopic(NAME)` works as expected in the `Mqttv5BackToBackTests` **Cherry-pick to `6.2.x` & `6.1.x`** # Conflicts: # spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java
I traced the bug in MQTT Paho Client .
And I found same problem in MQTT Paho Client issues https://github.com/eclipse/paho.mqtt.java/issues/984 |
Version 6.2.1
pom dependency
bean
bean inject and use
Describe the bug
Follow the code to run,
adapter.addTopic(topic)
will throwIndexOutOfBoundsException
The error location according to
IndexOutOfBoundsException
inMqttv5PahoMessageDrivenChannelAdapter
at line 279spring-integration/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java
Lines 273 to 289 in 0c83eaf
in
AbstractMqttMessageDrivenChannelAdapter
at line 293spring-integration/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java
Lines 281 to 299 in 0c83eaf
To Reproduce
as mentioned above
Expected behavior
adapter.addTopic(topic);
success to subscribe the topicThe text was updated successfully, but these errors were encountered: