https://github.com/ep2p/row-reuse-starter
A spring boot starter to run both row server and client and help reusing websocket connection.
https://github.com/ep2p/row-reuse-starter
Last synced: over 1 year ago
JSON representation
A spring boot starter to run both row server and client and help reusing websocket connection.
- Host: GitHub
- URL: https://github.com/ep2p/row-reuse-starter
- Owner: ep2p
- License: gpl-3.0
- Created: 2020-12-10T13:25:35.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-16T13:47:07.000Z (almost 5 years ago)
- Last Synced: 2025-01-08T13:27:03.664Z (over 1 year ago)
- Language: Java
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# row-reuse-starter [](https://jitpack.io/#idioglossia/row-client-server-starter)
A spring boot starter to run both row server and client and help **reusing websocket connection**.
Sample **application.yml** content to make it work:
```
row:
cs:
reuse: true
enable: true
ws:
enable: true
client:
enable: true
type: spring
handler:
track-heartbeats: false
```
Basically, using this library, two important things happen:
1. ROW client will add a logic to its message listener which will pass the **messages that don't look like a response** as a request to the `ProtocolService` of the server.
2. Row server will add a logic to its message listener which will pass the **messages that don't look like a request** to the client response handler. So it's assuming that they are response to a previously sent message.
Before you create a new RowClient, you may want to check if you can find an already persisting connection in `io.ep2p.row.server.repository.RowSessionRegistry()`.
If you could get the `RowServerWebsocket` from the `RowSessionRegistry` then you can easily reuse it as a client socket in your `RowClient` by calling `SpringReuseRowClientFactory.getRowClient()`