https://github.com/gregwhitaker/webflux-rsocket-example
Example of using RSocket with Spring WebFlux
https://github.com/gregwhitaker/webflux-rsocket-example
reactive reactive-streams rsocket spring-webflux
Last synced: 8 months ago
JSON representation
Example of using RSocket with Spring WebFlux
- Host: GitHub
- URL: https://github.com/gregwhitaker/webflux-rsocket-example
- Owner: gregwhitaker
- License: mit
- Created: 2019-11-03T00:33:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-03T04:10:50.000Z (about 6 years ago)
- Last Synced: 2025-03-31T02:21:30.610Z (10 months ago)
- Topics: reactive, reactive-streams, rsocket, spring-webflux
- Language: Java
- Homepage: http://www.rsocket.io
- Size: 85.9 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webflux-rsocket-example
An example of building Spring WebFlux services using [RSocket](http://www.rsocket.io) as the communication protocol.
The example exposes two RSocket services via Spring WebFlux and streams random letter and number data to a web broswer via SSE streaming.
## Projects
The example contains the following projects:
* [client](/client) - REST API that calls the letter and number backend RSocket services.
* [model](/model) - Domain model shared among the services.
* [letter-service](/letter-service) - RSocket service that generates random letters.
* [number-service](/number-service) - RSocket service that generates random numbers.
## Building the Example
Run the following command to build the example:
./gradlew clean build
## Running the Example
Follow the steps below to run the example:
1. Run the following command to start the `letter-service`:
./gradlew :letter-service:bootRun
2. In a new terminal, run the following command to start the `number-service`:
./gradlew :number-service:bootRun
3. In a new terminal, run the following command to start the `client`:
./gradlew :client:bootRun
4. In a web browser, navigate to [http://localhost:8080/letters](http://localhost:8080/letters) to receive a stream of `10` random letters with a delay of one second.
5. In a web browser, navigate to [http://localhost:8080/numbers](http://localhost:8080/numbers) to receive a stream of `10` random numbers with a delay of one second.
6. In a web browser, navigate to [http://localhost:8080/numbers?count=5](http://localhost:8080/numbers?count=5) to receive a stream of `5` random numbers with a delay of one second.
7. In a web browser, navigate to [http://localhost:8080/both](http://localhost:8080/both) to receive a stream of `10` pairs of random letter and number combinations with a delay of one second.
## Bugs and Feedback
For bugs, questions, and discussions please use the [Github Issues](https://github.com/gregwhitaker/webflux-rsocket-example/issues).
## License
MIT License
Copyright (c) 2019 Greg Whitaker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.