Skip to content
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

fixed subscription restore from client state when mqtt client reconnects #5048

Merged
merged 2 commits into from
May 28, 2021

Conversation

vipeller
Copy link
Contributor

@vipeller vipeller commented May 27, 2021

Cherry picked (#4189)

When an MQTT client used persistent session, the previous subscriptions did not get restored. If the same client connected to IoTHub directly, its subscriptions (e.g. for receiving twin responses) would have been restored.
In case of c# sdk it would not be a problem, because the sdk automatically resubscribes when it is able to restore the connection to edgeHub.

In case of python sdk however this does not happen. As a result, if a device connects using the python sdk and edgeHub gets restarted, the client will not be receiving m2m messages, twin patches, etc anymore.

The fix seems big but the main code in "MessagingServiceClient.cs", the rest is just the result of a changed interface and some plumbing.

@vipeller vipeller changed the title fixed subscription restore from client state when mqtt client reconnects (#4189) fixed subscription restore from client state when mqtt client reconnects May 27, 2021
Copy link
Contributor

@darobs darobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a fairly trivial comment, but it looks consistent w/the original.

using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Edge.Hub.Core.Identity;
using Microsoft.Azure.Devices.Edge.Util;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably don't need Microsoft.Azure.Devices.Edge.Util

@kodiakhq kodiakhq bot merged commit aadf030 into Azure:release/1.1 May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants