Skip to content

Commit 2519fc0

Browse files
committed
more polish
1 parent b93c41a commit 2519fc0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

articles/azure-web-pubsub/howto-develop-reliable-clients.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ The Web PubSub service supports two reliable subprotocols `json.reliable.webpubs
2323

2424
To use reliable subprotocols, you must set the subprotocol when constructing Websocket connections. In JavaScript, you can use the following code:
2525

26-
- Use Json reliable subprotocol
26+
- Use Json reliable subprotocol:
2727

2828
```js
2929
var pubsub = new WebSocket('wss://test.webpubsub.azure.com/client/hubs/hub1', 'json.reliable.webpubsub.azure.v1');
3030
```
3131

32-
- Use Protobuf reliable subprotocol
32+
- Use Protobuf reliable subprotocol:
3333

3434
```js
3535
var pubsub = new WebSocket('wss://test.webpubsub.azure.com/client/hubs/hub1', 'protobuf.reliable.webpubsub.azure.v1');
@@ -52,7 +52,7 @@ When the client reconnects to the service using reliable subprotocols, the clien
5252
}
5353
```
5454
55-
Once the WebSocket connection drops, the client should try to reconnect with the same `connectionId` to keep the restore the same session. Clients don't need to negotiate with the server and obtain the `access_token`. Instead, reconnection should make a websocket connect request directly to the service with the service host name, `connection_id`, and `reconnection_token`:
55+
Once the WebSocket connection drops, the client should try to reconnect with the same `connectionId` to restore the same session. Clients don't need to negotiate with the server and obtain the `access_token`. Instead, on reconnection the client should make a WebSocket connect request directly to the service with the service host name, `connection_id`, and `reconnection_token`:
5656

5757
```text
5858
wss://<service-endpoint>/client/hubs/<hub>?awps_connection_id=<connection_id>&awps_reconnection_token=<reconnection_token>
@@ -65,7 +65,9 @@ Reconnection may fail if the network issue hasn't been recovered yet. The client
6565
6666
## Publisher
6767
68-
Clients that send events to event handlers or publish messages to other clients are called publishers. Publishers should set `ackId` in the message to receive an acknowledgment from the Web PubSub service that publishing the message was successful or not. The `ackId` in message is the identifier of the message, each new message should use a unique ID. The original `ackId` should be used when resending a message.
68+
Clients that send events to event handlers or publish messages to other clients are called publishers. Publishers should set `ackId` in the message to receive an acknowledgment from the Web PubSub service that publishing the message was successful or not.
69+
70+
The `ackId` is the identifier of the message, each new message should use a unique ID. The original `ackId` should be used when resending a message.
6971
7072
A sample group send message:
7173
@@ -107,7 +109,7 @@ When the service experiences a transient internal error and the message can't be
107109

108110
![Message Failure](./media/howto-develop-reliable-clients/message-failed.png)
109111

110-
If the service's ack response is lost because the WebSocket connection dropped, the publisher should resend message with the same `ackId` after reconnection. When the message was previously processed by the service, it will send an ack containing a `Duplicate` error and the publisher should stop resending this message.
112+
If the service's ack response is lost because the WebSocket connection dropped, the publisher should resend the message with the same `ackId` after reconnection. When the message was previously processed by the service, it will send an ack containing a `Duplicate` error. The publisher should stop resending this message.
111113
112114
```json
113115
{

0 commit comments

Comments
 (0)