Giter VIP home page Giter VIP logo

danielliu1123 / grpc-starter Goto Github PK

View Code? Open in Web Editor NEW
28.0 2.0 3.0 1.12 MB

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

Home Page: https://danielliu1123.github.io/grpc-starter/

License: MIT License

Java 86.58% Shell 0.12% JavaScript 0.02% MDX 10.40% TypeScript 2.09% CSS 0.79%
grpc microservices spring-boot grpc-spring-boot-starter json-transcoding protobuf springboot3 protovalidate java spring

grpc-starter's Introduction

gRPC Starter Build Maven Central License: MIT

Documentation

gRPC is an RPC framework with robust features like high performance, multi-language support, 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 gRPC ecosystem. Make the integration of Spring Boot and gRPC feel seamless and native.

Features

Core:

Extensions:

Quick Start

implementation(platform("io.github.danielliu1123:grpc-starter-dependencies:3.3.1"))
implementation("io.github.danielliu1123:grpc-boot-starter")
@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> r) {
        var response = SimpleResponse.newBuilder()
                .setResponseMessage("Hello " + request.getRequestMessage())
                .build();
        r.onNext(response);
        r.onCompleted();
    }

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

}

Refer to quick-start.

Code of Conduct

This project is governed by the Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

Contributing

The issue tracker is the preferred channel for bug reports, feature requests and submitting pull requests.

If you would like to contribute to the project, please refer to Contributing.

License

The MIT License.

grpc-starter's People

Contributors

danielliu1123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

grpc-starter's Issues

One channel config create one single channel

grpc:
  client:
    channels:
      - authority: localhost:9090 
        classes:
          - io.grpc.reflection.v1alpha.ServerReflectionGrpc.ServerReflectionStub
          - io.grpc.reflection.v1alpha.ServerReflectionGrpc.ServerReflectionBlockingStub

Stub ServerReflectionStub and ServerReflectionBlockingStub should share one channel.

Native image support

If this feature gets strong feedback from the community, I will consider implementing it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.