wso2 / wso2/docs-apim

Add answers to these questions on WebSockets to docs

Open
#5,015 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API-M-4.0.0 API-M-4.1.0 CEXP Docs/TW Priority/Highest Type/Improvement Type/Question
Dominant language
CSS
Stars
99
Forks
708
Avg merge
1d 7h
Merged PRs (30d)
22

Description

How API gateway can close the connection if the client and server is idle more than an 5 hours?

The library used for WS communication is https://netty.io/wiki/user-guide-for-4.x.html. The default behavior does not implement any mechanism how to handle idle connection (which is fallen to default behavior i.e infinite), But if there is a requirement that should treat the idle connection specific way that may be an extension that needs to implement by utilzing https://netty.io/4.0/api/io/netty/handler/timeout/IdleStateHandler.html.


How the backend application will trust the API gateway WebSocket request and allow the connection?
What kind of Authentication we can use to establish connection between gateway and backend service?

Websockets (WS) BE (Backend) initiated connections can be trusted through the GW outbound synapse extensions. (Depending on the method team would prefer to validate such request such as verifying the signature of the incoming requests from BE with combination of specific headers, similar to how WebSub APIs BE channels secured with APIM 4.0.0) Please note WSO2 APIM WS released feature don't have UI to embed synapse extensions but, based on how team would like to proceed, we may need to check how to improve the WS API from publisher point of view to incorporate extensions per API.


How client can re-establish connection when gateway node is down and what kind of error messages , error code will be displayed in this scenario?

Client connection would automatically connect through a netty pipe via a duplex handler which allows that to exchange the websocket frame (as depicted in the diagram) refer [1]. Team is internally verifies whether any specific code that we need to monitor.

image


What kind of data can server/client send or exchange?

Netty.io should be capable of handling most of the streaming scenario, be specific what sort of use case you may look at from data exchange angle.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the questions and the linked Netty user guide and IdleStateHandler reference. Verify the gateway's documented behavior for idle connections, backend authentication, node failure and reconnection, error reporting, and exchanged data. Done means adding accurate answers for each question to the relevant WebSocket documentation, with any limitations clearly stated.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.