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

wss: make it more reliable by using subprotocols with ack #362

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

yongman
Copy link
Contributor

@yongman yongman commented Feb 2, 2024

If no subprotocol specified, message recived from websocket just have data field.

"data":{"type": "http.response.body", "body": "xxxx", "more_body": true, "response_id": "84f3f79faabb1ee1-LAX", "conversation_id": "9ec647f8-3945-4697-a3b8-e21edaf31017"}

If we specified the subprotocol to json.reliable.webpubsub.azure.v1, the message will be attached with sequence id,so we can send ack to server periodicly.

{"sequenceId":432,"type":"message","from":"server","dataType":"json","data":{"type": "http.response.body", "body": "xxx", "more_body": true, "response_id": "84f3f79faabb2ee1-LAX", "conversation_id": "9ec641f8-3945-4697-a3b8-e21edaf32017"}}

I guess in this case, the message will not be send agian after we send the ack message to server.

Signed-off-by: yongman <yming0221@gmail.com>
@yongman yongman changed the title wss: make more reliable by using subprotocols with ack wss: make it more reliable by using subprotocols with ack Feb 2, 2024
@moeakwak moeakwak merged commit ecb4047 into chatpire:dev Feb 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants