An open API service indexing awesome lists of open source software.

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

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)