https://github.com/ivan-montes/grpc-poc
Playing with Spring and gRPC using gRPC-Spring-Starter
https://github.com/ivan-montes/grpc-poc
grcp java spring
Last synced: about 2 months ago
JSON representation
Playing with Spring and gRPC using gRPC-Spring-Starter
- Host: GitHub
- URL: https://github.com/ivan-montes/grpc-poc
- Owner: Ivan-Montes
- License: gpl-3.0
- Created: 2024-12-04T06:34:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-19T07:20:28.000Z (over 1 year ago)
- Last Synced: 2025-03-29T11:16:25.040Z (about 1 year ago)
- Topics: grcp, java, spring
- Language: Java
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# grpc-poc
Playing with [Spring](https://spring.io/) and [gRPC](https://grpc.io/) using [gRPC-Spring-Starter](https://grpc-ecosystem.github.io/grpc-spring/en/)
### Components
| Name | gRPC Port | Web Port |
|------|-----------|-------------|
| ms-tuti-server | 50051 | x |
| ms-tuti-client | x | 8082 |
| ms-tuti-server-and-client | 50053 | 8083 |
| ms-tuti-cloud-server | 0 | 0 |
| ms-tuti-cloud-client | x | 8084 |
| ms-tuti-server-reactive | 50055 | x |
| ms-tuti-client-reactive | x | 8086 |
| eureka-discovery-server | x | 8761 |
### Installation
Download and compile
```
mvn clean compile
```
Then if you don't find all generated classes, please update your project from the specific pom.xml of that module
### Usage
You can use [grpcurl](https://github.com/fullstorydev/grpcurl) to call gRPC services
```
- List services
grpcurl --plaintext localhost:50051 list
- Call method
grpcurl --plaintext -d '{"name": "Bego"}' localhost:50051 net.protobufs.GrpcService.helloWorld
grpcurl --plaintext -d '{"name": "Marian"}' localhost:50055 net.protobufs.GrpcReactiveService.areYouSure
grpcurl --plaintext -d '{"name": "Maite"}' localhost:50053 net.protobufs.GrpcService.goodbyeWorld
```
It is possible to use a browser for calling a gRPC service using the client web server
```
http://localhost:8086/reactive/ays?name=Alazne
http://localhost:8083/api/bye?name=Frantxu
http://localhost:8084/cloud/sayHi?name=Leire
```
There is a ready eureka discovery server necessary to check the cloud version.
---
[](https://www.java.com/es/)
[](https://https://maven.apache.org/)
[](https://spring.io)
[](https://github.com)
[](https://https://eclipse.org/)
[](https://choosealicense.com/licenses/gpl-3.0/)