Skip to content

Ivan-Montes/grpc-poc

Repository files navigation

grpc-poc

Playing with Spring and gRPC using gRPC-Spring-Starter

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 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.


Java Maven Spring GitHub Eclipse GPLv3 license

About

Playing with Spring and gRPC using gRPC-Spring-Starter

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors

Languages