There is no starter named spring-boot-starter-grpc in the official Spring Boot starter list, so the name usually refers to one of two real libraries. The official one is the Spring gRPC project, whose starter is org.springframework.grpc:spring-grpc-spring-boot-starter. The older community one is net.devh:grpc-spring-boot-starter, which is where the @GrpcService annotation comes from. Both serve the same purpose: auto-configure a gRPC server and client channels in a Spring Boot application.
Check the exact coordinates and the Spring Boot version they support on the project page before you add one, because the Spring gRPC release line is tied to specific Boot versions.
| Library | Coordinates | Notes |
|---|---|---|
| Spring gRPC (official Spring project) | org.springframework.grpc:spring-grpc-spring-boot-starter | Maintained by the Spring team, follows Spring conventions |
| grpc-spring-boot-starter (community) | net.devh:grpc-server-spring-boot-starter, net.devh:grpc-client-spring-boot-starter | Long-standing; uses @GrpcService and @GrpcClient |
New projects should prefer Spring gRPC. Existing projects on the community starter should check that it supports the Spring Boot version they upgrade to before migrating.
gRPC is a remote procedure call framework that uses HTTP/2 and Protocol Buffers. You define services in a .proto file, generate Java classes, and call methods on a typed stub. Compared with JSON over REST it offers a compact binary format, streaming in both directions, deadlines and a strict contract.
A Spring gRPC starter takes care of the parts that are tedious to wire by hand:
Put this in src/main/proto/greeter.proto:
Generate the Java classes with the protobuf-maven-plugin or the Gradle com.google.protobuf plugin. The generated code contains GreeterGrpc with the base class GreeterGrpc.GreeterImplBase.
With the official starter, a service is a Spring bean that extends the generated base class. Registered BindableService beans are picked up automatically.
With the community starter the equivalent class is annotated @GrpcService instead of @Service:
The two annotations are not interchangeable: @GrpcService belongs to the community library, not to Spring itself. The server port is configured with spring.grpc.server.port in Spring gRPC (the default is 9090) and with grpc.server.port in the community starter.
A channel represents a connection and is thread-safe, so create it once and reuse it. With Spring gRPC you inject a GrpcChannelFactory and build a stub.
Set a deadline on production calls, for example stub.withDeadlineAfter(2, TimeUnit.SECONDS), so a slow server cannot hold callers forever. Named channels with their own addresses and TLS settings are configured under spring.grpc.client.*; see the project reference for the exact keys in your version.
NOT_FOUND, INVALID_ARGUMENT) instead of throwing generic exceptions.InProcessServerBuilder, which avoids real network ports.Not under that name in the standard Spring Boot starter list. Use the official Spring gRPC starter or the community net.devh starter, and verify the coordinates in their documentation.
From the community net.devh library. Spring gRPC registers service beans without that annotation.
Not entirely. gRPC suits internal service-to-service calls and streaming. Browsers cannot call it directly without a proxy such as gRPC-Web, so public APIs often stay REST or GraphQL.
Yes. The starter runs the server and channels, but the Java classes come from compiling your .proto files.
A gRPC starter wires a server and client channels into Spring Boot, but the name spring-boot-starter-grpc is not an official artifact. Choose Spring gRPC for new work or the community net.devh starter for existing code, define the contract in .proto files, implement the generated base class as a Spring bean, and use TLS, deadlines and proper status codes in production.