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
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,17 @@ This document describes the subprotocol json.reliable.webpubsub.azure.v1.
17
17
> [!NOTE]
18
18
> Reliable protocols are still in preview. Some changes are expected in the future.
19
19
20
-
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.
20
+
When Websocket client connections drop due to intermittent network issues, messages can be lost. In a pub/sub system, publishers are decoupled from subscribers and may not detect a subscribers' dropped connection or message loss.
21
21
22
-
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.
22
+
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*.
23
+
24
+
A *Reliable PubSub WebSocket client* can:
25
+
26
+
* reconnect a dropped connection.
27
+
* recover from message loss.
28
+
* join a group using [join requests](#join-groups).
29
+
* publish messages directly to a group using [publish requests](#publish-messages).
30
+
* route messages directly to upstream event handlers using [event requests](#send-custom-events).
23
31
24
32
For example, you can create a *Reliable PubSub WebSocket client* with the following JavaScript code:
25
33
@@ -29,7 +37,7 @@ var pubsub = new WebSocket('wss://test.webpubsub.azure.com/client/hubs/hub1', 'j
29
37
30
38
See [How to create reliable clients](./howto-develop-reliable-clients.md) to implement reconnection and message reliability for publisher and subscriber clients.
31
39
32
-
When the client is using this subprotocol, both outgoing and incoming data frames are expected to contain JSON payloads.
40
+
When the client is using this subprotocol, both outgoing and incoming data frames must contain JSON payloads.
Reliable PubSub WebSocket client must send a sequence ack message once it receives a message from the service. For more information, see [How to create reliable clients](./howto-develop-reliable-clients.md#subscriber)
52
60
53
-
*`sequenceId` is a incremental uint64 number from the message received.
61
+
*`sequenceId` is an incremental uint64 number from the message received.
54
62
55
63
## Responses
56
64
57
65
Messages received by the client can be several types: `ack`, `message`, and `system`. Messages with type `message` have `sequenceId` property. Client must send a [Sequence Ack](#sequence-ack) to the service once it receives a message.
58
66
59
67
### Ack response
60
68
61
-
When the request contains `ackId`, the service will return an ack response for this request. The client implementation should handle this ack mechanism, including waiting for the ack response using an `async``await` operation, and have a timeout handler when the ack response is not received during a certain period.
69
+
When the request contains `ackId`, the service will return an ack response for this request. The client implementation should handle this ack mechanism, including waiting for the ack response using an `async``await` operation, and have a timeout handler when the ack response isn't received during a certain period.
62
70
63
71
Format:
64
72
```json
@@ -182,7 +190,7 @@ Find more details in [Reconnection](./howto-develop-reliable-clients.md#reconnec
182
190
183
191
#### Disconnected
184
192
185
-
When the server closes the connection, or when the service declines the client.
193
+
The response when the server closes the connection or when the service declines the client connection.
0 commit comments