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

Missing pubsub messages between client disconnect and reconnect #198

Open
vicancy opened this issue Jul 21, 2021 · 1 comment
Open

Missing pubsub messages between client disconnect and reconnect #198

vicancy opened this issue Jul 21, 2021 · 1 comment

Comments

@vicancy
Copy link
Member

vicancy commented Jul 21, 2021

<Copied from https://docs.microsoft.com/en-us/answers/questions/482237/missing-pubsub-messages-between-client-disconnect.html>
We are using Azure web pubsub to push events realtime to devices. The client connects to the websocket url and the server pushes event messages to clients through pubsub using azure pubsub python sdk. We found that the pubsub resends unsent event messages to clients and sometimes it does not.

There are two scenarios:

  • When the device stays unlocked.

When the client app disconnects and reconnects after sometime, the pubsub resends the missing event messages from server during this time. The unsent event messages are even resent to client app when it goes to background and comes to
foreground(reconnects to pubsub) after 1 hour!

  • When the device is locked and unlocked in between

The problem occurs when the device is locked. When its locked we found that the websocket connection gets immediately
disconnected and when the screen is unlocked, the client app does not get the unsent event messages during this period.
The client app, though, keeps on getting the new messages after the device is unlocked.

We want to understand the working of pubsub's retry mechanism in case of unsent event messages and its guarantees. We could not find any documentation related to this in the microsoft docs.

@vicancy
Copy link
Member Author

vicancy commented Jul 21, 2021

  1. Web PubSub itself does not have a message delivery guarantee, it acts as a broker that delivers real-time messages to connected WebSocket clients. So if the WebSocket connection is disconnected, the client does not get the messages sent during this period. if you want to guarantee message delivery, consider supporting it in your application protocol or using a protocol having such mechanism, e.g. MQTT.

  2. "When the client app disconnects and reconnects after sometime, the pubsub resends the missing event messages from server during this time." => No, Web PubSub does not have a mechanism to "resend" messages, it does not preserve messages. Could you describe more about how your server-side sends event messages, is there any retry logic from your server-side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant