A RSocket protocol stream POC in order to evaluate async/reactive services communications
Based on RSocket SPI from Spring Framework
The server is in charge to receive the request from client and stream out based on interval of one second.
To start the server prompt from command line
@ cd server
$ ./mvnw clean package spring-boot:run -DskipTests=true
The client support two kinds of iteration mode:
- Spring command line using directly the terminal
- REST Endpoints
To start the client prompt from command line
@ cd client
$ ./mvnw clean package spring-boot:run -DskipTests=true
There are the following endpoints that will consume the provider RSocket to reach out the MongoDB
Endpoint | MediaType | Interaction Mode |
---|---|---|
http:https://localhost:8080/order/stream | text/event-stream | Stream |
http:https://localhost:8080/order/stream/monitor/{orderId} | text/event-stream | Stream |
http:https://localhost:8080/order/{orderId} | application/json | Request-Response |
The build can be done to use the built in (requires Docker) plugins that will generate docker images, in order to use that prompt from terminal:
@ cd {project_moduel}
$ ./mvnw spring-boot:build-image -DskipTests=true
$ docker run -p 8080:8080 {image}
Further details from Protobuff
The PB compiler can be download from Maven Central and have to copied to ${BASE_DIR_REPO}/server/src/main
From terminal execute
$ protc --java_out=java resources/Order.proto
Measure the latency between services communications as well as security and resource consumption when using channel/stream interaction models.
Based on GitHub Actions towards client and server that will be enforced by CI when open a PR to master branch.
Please fell free to open a PR that will be very welcome.
MIT