{"id":17685254,"url":"https://github.com/doublemine/grpc-springboot-starter","last_synced_at":"2026-05-18T00:32:49.728Z","repository":{"id":98437322,"uuid":"116968292","full_name":"Doublemine/grpc-springboot-starter","owner":"Doublemine","description":"Spring Boot starter module for gRPC framework.","archived":false,"fork":false,"pushed_at":"2018-01-22T07:34:12.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T14:54:14.176Z","etag":null,"topics":["grpc"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Doublemine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-10T14:28:37.000Z","updated_at":"2019-04-03T05:11:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"200e1732-8690-4380-a616-f083eeb56462","html_url":"https://github.com/Doublemine/grpc-springboot-starter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Doublemine/grpc-springboot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doublemine%2Fgrpc-springboot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doublemine%2Fgrpc-springboot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doublemine%2Fgrpc-springboot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doublemine%2Fgrpc-springboot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Doublemine","download_url":"https://codeload.github.com/Doublemine/grpc-springboot-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doublemine%2Fgrpc-springboot-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc"],"created_at":"2024-10-24T10:27:09.047Z","updated_at":"2026-05-18T00:32:49.699Z","avatar_url":"https://github.com/Doublemine.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"### [gRPC](https://github.com/grpc/grpc-java) Spring Boot Starter [![](https://jitpack.io/v/Doublemine/grpc-springboot-starter.svg)](https://jitpack.io/#Doublemine/grpc-springboot-starter)  [![Build Status](https://travis-ci.org/Doublemine/grpc-springboot-starter.svg?branch=master)](https://travis-ci.org/Doublemine/grpc-springboot-starter)\n\n\n### TODO\n\n- [x] add client interceptor\n\n\n### Usage\n\n\n#### dependencies\n\n\n##### Gradle\n\nStep 1. Add the JitPack repository to your build file\n\n\nAdd it in your root build.gradle at the end of repositories:\n\n\n```gradle\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\nStep 2. Add the dependency\n \n\n```gradle\n\tdependencies {\n\t        compile 'com.github.Doublemine.grpc-springboot-starter:starter:1.0'\n\t}\n```\n\n##### Maven\n\nStep 1. Add the JitPack repository to your build file\n\n```xml\n\t\u003crepositories\u003e\n\t\t\u003crepository\u003e\n\t\t    \u003cid\u003ejitpack.io\u003c/id\u003e\n\t\t    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\t\t\u003c/repository\u003e\n\t\u003c/repositories\u003e\n\n```\n\nStep 2. Add the dependency\n\n\n```xml\n\t\u003cdependency\u003e\n\t    \u003cgroupId\u003ecom.github.Doublemine.grpc-springboot-starter\u003c/groupId\u003e\n\t    \u003cartifactId\u003estarter\u003c/artifactId\u003e\n\t    \u003cversion\u003e1.0\u003c/version\u003e\n\t\u003c/dependency\u003e\n```\n\n#### Grpc Server:\n\n##### Enable Server\n\n - Use annotation `@EnableGrpcServer` or `grpc.server.enable=true` in application.properties to Enable Grpc Server.\n - The default server port is `9494`.\n - You can change the host and port in application.properties:\n \n ```properties\ngrpc.server.enable=true\n```\n\n##### GrpcService\n\nAnnotate your server interface implementation(s) with ``@GrpcService``\n\n```java\n@GrpcService\npublic class HelloService extends GreeterGrpc.GreeterImplBase {\n    @Override\n    public void sayHello(HelloRequest request, StreamObserver\u003cHelloReply\u003e responseObserver) {\n        HelloReply reply = HelloReply.newBuilder().setMessage(\"Hello \" + request.getName()).build();\n        responseObserver.onNext(reply);\n        responseObserver.onCompleted();\n    }\n}\n```\n\n##### Interceptor\n\nAs private Intercept Or Annotate your ServerInterceptor interface implementation(s) with ``@GlobalInterceptor``\n\n```java\n\n@GlobalInterceptor // As Global interceptor\npublic class ServerLogInterceptor implements ServerInterceptor {\n\n\tprivate static final Logger logger = LoggerFactory.getLogger(LogInterceptor.class.getName());\n\n\tstatic final Metadata.Key\u003cString\u003e CUSTOM_HEADER_KEY =\n\t\t\tMetadata.Key.of(\"custom_server_header_key\", Metadata.ASCII_STRING_MARSHALLER);\n\n\t@Override\n\tpublic \u003cReqT, RespT\u003e ServerCall.Listener\u003cReqT\u003e interceptCall(ServerCall\u003cReqT, RespT\u003e call,\n\t\t\tMetadata headers, ServerCallHandler\u003cReqT, RespT\u003e next) {\n\t\tlogger.info(\"header received from client:\" + headers);\n\n\t\treturn next.startCall(new ForwardingServerCall.SimpleForwardingServerCall\u003cReqT, RespT\u003e(call) {\n\t\t\t@Override\n\t\t\tpublic void sendHeaders(Metadata responseHeaders) {\n\t\t\t\tresponseHeaders.put(CUSTOM_HEADER_KEY, \"customRespondValue\");\n\t\t\t\tsuper.sendHeaders(responseHeaders);\n\t\t\t}\n\t\t}, headers);\n\t}\n}\n```\nAnnotate your server interface implementation(s) with ``@GrpcService``\n\n```java\n@GrpcService(applyGlobalInterceptor = true)/*or you can use private interceptor or both*/\n//@GrpcService(interceptors = ServerLogInterceptor.class)\npublic class HelloService extends GreeterGrpc.GreeterImplBase {\n    @Override\n    public void sayHello(HelloRequest request, StreamObserver\u003cHelloReply\u003e responseObserver) {\n        HelloReply reply = HelloReply.newBuilder().setMessage(\"Hello \" + request.getName()).build();\n        responseObserver.onNext(reply);\n        responseObserver.onCompleted();\n    }\n}\n```\n\n\n\n\n#### Grpc Client:\n\n##### Enable Client\n\n - Use annotation `@EnableGrpcClient` or `grpc.client.enable=true` in application.properties to Enable Grpc Server.\n \n ##### Property\n \n \n  - The Annotation `@GrpcClientChannel` default value is `defaultClient` if not present to inject gRPC channel.\n  the default host is `localhost` and default port is `9494`.\n \n \n ```properties\ngrpc.client.(gRPC server name).host=127.0.0.1\ngrpc.client.(gRPC server name).port=9494\n# optional\ngrpc.client.(gRPC server name).plaintext=true\ngrpc.client.(gRPC server name).enable-keep-alive=false\ngrpc.client.(gRPC server name).keep-alive-without-calls=false\ngrpc.client.(gRPC server name).keep-alive-time=180\ngrpc.client.(gRPC server name).keep-alive-timeout=40\n```\n \nThen, you can inject channel:\n\n```java\npublic class GrpcClientService {\n\n    @GrpcClientChannel(\"\u003cgRPC server name\u003e\")\n    private Channel channel;\n\n    public String sendMessage(String name) {\n        GreeterGrpc.GreeterBlockingStub stub = GreeterGrpc.newBlockingStub(channel);\n        HelloReply response = stub.sayHello(HelloRequest.newBuilder().setName(name).build());\n        return response.getMessage();\n    }\n}\n```\n\n### Sample\nsee the [sample module](https://github.com/Doublemine/grpc-springboot-starter/tree/master/sample/src/main/java/work/wanghao/kotlin/boot/grpc/sample)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoublemine%2Fgrpc-springboot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoublemine%2Fgrpc-springboot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoublemine%2Fgrpc-springboot-starter/lists"}