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
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/reference-json-reliable-webpubsub-subprotocol.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,29 @@ ms.topic: conceptual
8
8
ms.date: 01/04/2023
9
9
---
10
10
11
-
# Azure Web PubSub supported Reliable JSON WebSocket subprotocol
12
-
13
-
This document describes the subprotocol `json.reliable.webpubsub.azure.v1`.
11
+
# Azure Web PubSub supported Reliable JSON WebSocket subprotocol
14
12
15
-
When the client is using this subprotocol, both outgoing data frame and incoming data frame are expected to be **JSON** payloads.
13
+
The JSON WebSocket subprotocol, `json.reliable.webpubsub.azure.v1`, enables the highly reliable exchange of publish/subscribe messages directly between clients even under network issues.
14
+
15
+
This document describes the subprotocol json.reliable.webpubsub.azure.v1.
16
16
17
17
> [!NOTE]
18
18
> Reliable protocols are still in preview. Some changes are expected in future.
19
19
20
20
## Overview
21
21
22
-
Subprotocol `json.reliable.webpubsub.azure.v1` empowers the client to have a high reliable message delivery experience under network issues and do a publish-subscribe (PubSub) directly instead of doing a round trip to the upstream server. The WebSocket connection with the `json.reliable.webpubsub.azure.v1` subprotocol is called a Reliable PubSub WebSocket client.
22
+
When Websocket client connections drop due to intermittent network issues, messages can be lost. In a pubsub system, publishers are decoupled from subscribers and may not detect a subscribers' dropped connection or message loss. To overcome intermittent network issues and maintain reliable message delivery, you can use the Azure WebPubSub `json.reliable.webpubsub.azure.v1` subprotocol to create a *Reliable PubSub WebSocket client*. A *Reliable PubSub WebSocket client* can reconnect a dropped connection.
23
+
24
+
For example, in JavaScript, you can create a *Reliable PubSub WebSocket client* with the following code:
23
25
24
-
For example, in JS, a Reliable PubSub WebSocket client can be created using:
25
26
```js
26
27
var pubsub =newWebSocket('wss://test.webpubsub.azure.com/client/hubs/hub1', 'json.reliable.webpubsub.azure.v1');
27
28
```
28
29
29
30
When using `json.reliable.webpubsub.azure.v1` subprotocol, see [How to create reliable clients](./howto-develop-reliable-clients.md) to implement reconnection, publisher and subscriber for clients.
30
31
32
+
When the client is using this subprotocol, both outgoing data frame and incoming data frame are expected to be **JSON** payloads.
0 commit comments