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
Description
I want to add multiple instances of Mqttv5PahoMessageDrivenChannelAdapter (on demand, when application is running) using already running client in Mqttv5ClientManager as constructor parameter. When I try, it does not work.
Cause seams to be MqttCallback:: connectComplete ,which sets the readyToSubscribeOnStart property.
That obviously cant trigger because client is already connected.
To Reproduce
Create an instance of Mqttv5ClientManager
Start clientManager
create an instance of Mqttv5PahoMessageDrivenChannelAdapter with clientManager
register adapter in IntegrationFlow using IntegrationFlowContext
It looks like the ClientManager should expose an isConnection() API.
The problem is that your ClientManager has been started and connected.
So, all those dynamically added channel adapters at runtime just lose their connectComplete() callback.
Therefore in the AbstractMqttMessageDrivenChannelAdapter.onInit() we should check for the mentioned ClientManager.isConnection() and set readyToSubscribeOnStart = true.
So, when this dynamic channel adapter is started it will understand that it is already OK to subscribe.
I changing this to Enhancement since we never advertised that such a scenario is supposed to work.
So, new feature for new version.
Will review your PR shortly.
Thanks
Ricore72
added a commit
to Ricore72/spring-integration
that referenced
this issue
Aug 16, 2024
version 6.3.1
Description
I want to add multiple instances of Mqttv5PahoMessageDrivenChannelAdapter (on demand, when application is running) using already running client in Mqttv5ClientManager as constructor parameter. When I try, it does not work.
Cause seams to be MqttCallback:: connectComplete ,which sets the readyToSubscribeOnStart property.
That obviously cant trigger because client is already connected.
To Reproduce
Possible Fix
https://github.com/Ricore72/spring-integration
The fix does not work completely.
It only works if Handlers and adapters using same clientManager have the same Qos.
Note
I am not sure if this is the proper way to do this. This is my first issue to public project. So sorry if it is incorrect in any way.
The text was updated successfully, but these errors were encountered: