https://github.com/ztrzaska/grpc
gRPC high performance microservices with Spring Boot
https://github.com/ztrzaska/grpc
grpc grpc-client grpc-java grpc-server microservices spring-boot
Last synced: about 1 year ago
JSON representation
gRPC high performance microservices with Spring Boot
- Host: GitHub
- URL: https://github.com/ztrzaska/grpc
- Owner: ztrzaska
- Created: 2022-07-14T14:07:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-28T14:16:14.000Z (over 3 years ago)
- Last Synced: 2025-01-29T09:30:52.171Z (about 1 year ago)
- Topics: grpc, grpc-client, grpc-java, grpc-server, microservices, spring-boot
- Language: Java
- Homepage:
- Size: 77.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gRPC high performance microservices with Spring Boot
### Getting Started
This project demonstrates spring boot microservices by using grpc communication. One of modules exposes grpc endpoints. Another microservice works as grpc client which calls grpc api.
```
mvn clean install
cd rental-grpc-service
mvn spring-boot:run
```
### Calling gRPC methods
```
grpcurl --plaintext localhost:9090 list
grpcurl --plaintext localhost:9090 list pl.ztrzaska.grpc.ReservationService
grpcurl --plaintext -d "{\"period\": \"month\", \"cost\": \"500\", \"renterId\": \"1\", \"objectForRentId\": \"1\"}" localhost:9090 pl.ztrzaska.grpc.ReservationService/reserve
grpcurl --plaintext -d "{\"id\": \"1\", \"cost\": \"400\", \"period\": \"month\"}" localhost:9090 pl.ztrzaska.grpc.ReservationService/modify
grpcurl --plaintext -d "{\"name\": \"RENTER1\"}" localhost:9090 pl.ztrzaska.grpc.ReservationService/findByRenter
grpcurl --plaintext -d "{\"name\": \"NAME1\"}" localhost:9090 pl.ztrzaska.grpc.ReservationService/findByObjectForRentName
```
### Reference Documentation
For further reference, please consider the following sections:
* [Grpc protocol](https://grpc.io/)
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.0/maven-plugin/reference/html/)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.7.0/reference/htmlsingle/#data.sql.jpa-and-spring-data)
### Guides
The following guides illustrate how to use some features concretely:
* [Spring boot gRPC](https://yidongnan.github.io/grpc-spring-boot-starter/en/server/getting-started.html)
* [Grpc stubs with Spring Boot](https://yidongnan.github.io/grpc-spring-boot-starter/en/client/getting-started.html)