https://github.com/danielliu1123/grpc-starter
Out-of-the-box, highly extensible Spring Boot starters for the cutting-edge gRPC ecosystem and modern Java — more integration, less abstraction.
https://github.com/danielliu1123/grpc-starter
grpc grpc-gateway grpc-spring-boot-starter java json-transcoding microservices protobuf protovalidate spring spring-boot
Last synced: 3 months ago
JSON representation
Out-of-the-box, highly extensible Spring Boot starters for the cutting-edge gRPC ecosystem and modern Java — more integration, less abstraction.
- Host: GitHub
- URL: https://github.com/danielliu1123/grpc-starter
- Owner: DanielLiu1123
- License: mit
- Created: 2023-04-29T01:13:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-01T18:18:42.000Z (4 months ago)
- Last Synced: 2025-09-01T19:30:59.867Z (4 months ago)
- Topics: grpc, grpc-gateway, grpc-spring-boot-starter, java, json-transcoding, microservices, protobuf, protovalidate, spring, spring-boot
- Language: Java
- Homepage: https://danielliu1123.github.io/grpc-starter/
- Size: 1.6 MB
- Stars: 82
- Watchers: 2
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
#
gRPC Starter [](https://github.com/DanielLiu1123/grpc-starter/actions) [](https://central.sonatype.com/artifact/io.github.danielliu1123/grpc-starter-dependencies) [](https://opensource.org/licenses/MIT)
[gRPC](https://grpc.io/) is a high-performance RPC framework that supports multiple languages, concise service definitions, and streaming. It is an ideal choice for building scalable and efficient microservice systems.
This project provides out-of-the-box, highly extensible Spring Boot starters for the gRPC ecosystem, making the integration of Spring Boot and gRPC seamless and native.
## Quick Start
```groovy
implementation(platform("io.github.danielliu1123:grpc-starter-dependencies:"))
implementation("io.github.danielliu1123:grpc-boot-starter")
implementation("io.grpc:grpc-testing-proto")
```
```java
@SpringBootApplication
public class QuickStartApp extends SimpleServiceGrpc.SimpleServiceImplBase {
public static void main(String[] args) {
new SpringApplicationBuilder(QuickStartApp.class)
.properties("grpc.client.base-packages=io.grpc") // scan packages for gRPC clients
.properties("grpc.client.authority=127.0.0.1:9090") // default authority for gRPC clients
.run(args);
}
@Override
public void unaryRpc(SimpleRequest request, StreamObserver r) {
var response = SimpleResponse.newBuilder()
.setResponseMessage("Hello " + request.getRequestMessage())
.build();
r.onNext(response);
r.onCompleted();
}
@Bean
ApplicationRunner runner(SimpleServiceGrpc.SimpleServiceBlockingStub stub) { // inject gRPC client
return args -> {
var response = stub.unaryRpc(SimpleRequest.newBuilder().setRequestMessage("World!").build());
System.out.println(response.getResponseMessage());
};
}
}
```
Refer to [quick-start](examples/quick-start).
## Features
### Core:
- Dependency management for gRPC-related libraries
- gRPC server autoconfiguration
- [Exception handling](https://danielliu1123.github.io/grpc-starter/docs/server/exception-handing)
- [Health check](https://danielliu1123.github.io/grpc-starter/docs/server/autoconfiguration#health)
- gRPC client autoconfiguration
- [`@Autowired` support](https://danielliu1123.github.io/grpc-starter/docs/client/autoconfiguration#inject-client)
- [Dynamic refreshing](https://danielliu1123.github.io/grpc-starter/docs/client/dynamic-refresh)
### Extensions:
- [gRPC HTTP transcoding](https://danielliu1123.github.io/grpc-starter/docs/extensions/grpc-http-transcoding): Support both gRPC and HTTP/JSON with a single codebase, with optional OpenAPI integration.
- [Protobuf validation](https://danielliu1123.github.io/grpc-starter/docs/extensions/protobuf-validation): Protobuf message validation using [protovalidate](https://github.com/bufbuild/protovalidate-java) and [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate).
- [Metrics](https://danielliu1123.github.io/grpc-starter/docs/extensions/metrics): Integrate Spring Boot Actuator with gRPC services.
- [Tracing](https://danielliu1123.github.io/grpc-starter/docs/extensions/tracing): Integrate Spring Boot Actuator with gRPC server and client.
- [Testing](https://danielliu1123.github.io/grpc-starter/docs/extensions/test): Integration with `SpringBootTest`.
## Documentation
Go to [Reference Documentation](https://danielliu1123.github.io/grpc-starter/docs/intro) for more information.
## Build
```shell
./gradlew build
```
## Code of Conduct
This project is governed by the [Code of Conduct](./CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code of conduct.
Please report unacceptable behavior to llw599502537@gmail.com.
## Contributing
Use the [issue tracker](https://github.com/DanielLiu1123/grpc-starter/issues) for bug reports, feature requests, and submitting pull requests.
If you would like to contribute to the project, please refer to [Contributing](./CONTRIBUTING.md).
## License
The MIT License.