Using Spring Boot together with gRPC and Protobuf

Markus picture Markus · Aug 11, 2015 · Viewed 36.7k times · Source

Anyone having any examples or thoughts using gRPC together with Spring Boot?

Answer

Alexander.Furer picture Alexander.Furer · Feb 1, 2016

If it's still relevant for you, I've created gRPC spring-boot-starter here.

grpc-spring-boot-starter auto-configures and runs the embedded gRPC server with @GRpcService-enabled beans.

The simplest example :

@GRpcService(grpcServiceOuterClass = GreeterGrpc.class)
public static class GreeterService implements GreeterGrpc.Greeter {

    @Override 
    public void sayHello(GreeterOuterClass.HelloRequest request, StreamObserver<GreeterOuterClass.HelloReply> responseObserver) {
      // omitted 
    }

}

There is also an example of how to integrate the starter with Eureka in project's README file.