-
Notifications
You must be signed in to change notification settings - Fork 645
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
[MQTT] Reestablish subscriptions after reconnect #1824
Comments
Thanks for the ticket. As a workaround one could try disabling Paho reconnect logic and instead use Another workaround is to use Alpakka Mqtt Streaming connector, however that connector provides quite a low level API (different API is being worked on in #1565) |
Should you have to re-subscribe given the continuation of a session? I don’t recall the spec stating that you should need to as the previous subscriptions should be continued. |
@ffendt have you tried |
The mqtt streaming connector currently is no real option for us, since as you said it only provides a very low level API which we don't want to use as of now. I also stumbled upon the |
Hi there,
I am a developer of Eclipse Ditto which uses akka-stream-alpakka-mqtt and think I found a little bug concerning its reconnecting functionality.
The issue seems to be that after a reconnect (because e.g. the broker was unreachable) the subscriptions aren't reestablished. So after a reconnect I am not able to receive messages any longer (publishing will work though).
When debugging my application, I can see that MqttFlowStage#connectComplete callback is called by the paho client after a successful reconnect.
The paho team suggests to resubscribe in the callback. As far as I understand (with my very little Scala knowledge) the subscriptions are only established once in MqttFlowStage#onConnect which is called after the initial connect (see MqttFlowStage#preStart ).
In the gitter chat, @2m suggested to move the subscription logic to
connectComplete
. As my company has relatively strict rules on contributing code, I don't know yet if or when I will be allowed to provide a PR for this.Best regards
Florian
The text was updated successfully, but these errors were encountered: