Skip to content

Offering out-of-the-box, highly scalable Spring Boot starters for the cutting-edge ecosystem of gRPC.

License

Notifications You must be signed in to change notification settings

sakiila/grpc-starter

 
 

Repository files navigation

gRPC Starter

Build Maven Central License: MIT

Documentation

Overview

This project provides out-of-the-box, highly scalable Spring Boot starters for the cutting-edge ecosystem of gRPC.

Make the integration of gRPC with Spring Boot feel seamless and native.

Features

Core:

Extensions:

Quick Start

implementation(platform("io.github.danielliu1123:grpc-starter-dependencies:3.2.5"))
implementation("io.github.danielliu1123:grpc-boot-starter")

From version 3.2.0, the groupId of the project has been changed to io.github.danielliu1123 from com.freemanan.

@SpringBootApplication
public class SimpleApp extends SimpleServiceGrpc.SimpleServiceImplBase {

    public static void main(String[] args) {
        new SpringApplicationBuilder(SimpleApp.class)
                .properties("grpc.client.base-packages=io.grpc")
                .properties("grpc.client.authority=127.0.0.1:9090")
                .run(args);
    }

    @Override
    public void unaryRpc(SimpleRequest request, StreamObserver<SimpleResponse> responseObserver) {
        SimpleResponse response = SimpleResponse.newBuilder()
                .setResponseMessage("Hello " + request.getRequestMessage())
                .build();
        responseObserver.onNext(response);
        responseObserver.onCompleted();
    }

    @Bean
    ApplicationRunner runner(SimpleServiceGrpc.SimpleServiceBlockingStub stub) {
        return args -> {
            SimpleResponse response = stub.unaryRpc(SimpleRequest.newBuilder().setRequestMessage("World!").build());
            System.out.println(response.getResponseMessage());
        };
    }

}

See the example project。

Version

Mainly maintain the following versions:

  • 3.x

    Based on Spring Boot 3, baseline is JDK 17, the corresponding branch is main.

    3.x version is kept in sync with Spring Boot 3, if you are using Spring Boot 3.2.x, then grpc-boot-starter 3.2.5 should be used.

    Spring Boot grpc-boot-starter
    3.1.x 3.1.8
    3.2.x 3.2.5
  • 2.x

    Based on Spring Boot 2, baseline is JDK 8, the corresponding branch is 2.x

    Spring Boot grpc-boot-starter
    2.x 2.1.6

License

The MIT License.

About

Offering out-of-the-box, highly scalable Spring Boot starters for the cutting-edge ecosystem of gRPC.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%