{"id":18559016,"url":"https://github.com/linux-china/reactive-grpc-demo","last_synced_at":"2025-04-10T02:30:36.518Z","repository":{"id":136595854,"uuid":"175280343","full_name":"linux-china/reactive-grpc-demo","owner":"linux-china","description":"gRPC with reactive Reactor","archived":false,"fork":false,"pushed_at":"2025-03-05T03:16:49.000Z","size":85,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T02:51:13.155Z","etag":null,"topics":["grpc","reactive","spring-boot"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linux-china.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-12T19:11:05.000Z","updated_at":"2025-03-05T03:16:52.000Z","dependencies_parsed_at":"2024-02-06T12:27:38.627Z","dependency_job_id":"bce3fa33-fa5c-4693-a423-7dbf76cb8ad0","html_url":"https://github.com/linux-china/reactive-grpc-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Freactive-grpc-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Freactive-grpc-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Freactive-grpc-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Freactive-grpc-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/reactive-grpc-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144155,"owners_count":21054876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","reactive","spring-boot"],"created_at":"2024-11-06T21:41:51.296Z","updated_at":"2025-04-10T02:30:36.137Z","avatar_url":"https://github.com/linux-china.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Reactive gRPC Spring Boot Demo\n==============================\n\nSpring Boot Application with reactive gRPC support backbone by https://github.com/salesforce/reactive-grpc and https://github.com/LogNet/grpc-spring-boot-starter\n\n### Development\n\n\n* Modify protobuf-maven-plugin with 'reactor-grpc' protocPlugin support\n\n```xml\n\u003cplugin\u003e\n   \u003cgroupId\u003eorg.xolstice.maven.plugins\u003c/groupId\u003e\n   \u003cartifactId\u003eprotobuf-maven-plugin\u003c/artifactId\u003e\n   \u003cversion\u003e0.6.1\u003c/version\u003e\n   \u003cconfiguration\u003e\n       \u003cprotocArtifact\u003ecom.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}\n       \u003c/protocArtifact\u003e\n       \u003cpluginId\u003egrpc-java\u003c/pluginId\u003e\n       \u003cpluginArtifact\u003eio.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}\n       \u003c/pluginArtifact\u003e\n       \u003cprotocPlugins\u003e\n           \u003cprotocPlugin\u003e\n               \u003cid\u003ereactor-grpc\u003c/id\u003e\n               \u003cgroupId\u003ecom.salesforce.servicelibs\u003c/groupId\u003e\n               \u003cartifactId\u003ereactor-grpc\u003c/artifactId\u003e\n               \u003cversion\u003e${reactive-grpc.version}\u003c/version\u003e\n               \u003cmainClass\u003ecom.salesforce.reactorgrpc.ReactorGrpcGenerator\u003c/mainClass\u003e\n           \u003c/protocPlugin\u003e\n       \u003c/protocPlugins\u003e\n   \u003c/configuration\u003e\n   \u003cexecutions\u003e\n       \u003cexecution\u003e\n           \u003cgoals\u003e\n               \u003cgoal\u003ecompile\u003c/goal\u003e\n               \u003cgoal\u003ecompile-custom\u003c/goal\u003e\n           \u003c/goals\u003e\n       \u003c/execution\u003e\n   \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n* Implement gRPC service to extend reactive class\n\n```\n@GRpcService\npublic class ReactiveAccountServiceGrpcImpl extends ReactorAccountServiceGrpc.AccountServiceImplBase {\n    @Autowired\n    private AccountService accountService;\n\n    @Override\n    public Mono\u003cAccountResponse\u003e findAccountById(Mono\u003cGetAccountRequest\u003e request) {\n        return request.map(GetAccountRequest::getId)\n                .flatMap(accountService::findById)\n                .map(AccountMapper.INSTANCE::pojoToProtobuf);\n    }\n}\n```\n\n* Start Spring Boot application and test with evans\n\n```\nevans src/main/proto/account.proto\n```\n\n### Mapper between domain model and Protobuf message\n\nPlease refer MapStruct http://mapstruct.org\n\n### References\n\n* Reactive gPRC: \u003chttps://github.com/salesforce/reactive-grpc\u003e\n* Spring Boot starter module for gRPC framework: \u003chttps://github.com/LogNet/grpc-spring-boot-starter\u003e\n* Evans: \u003chttps://github.com/ktr0731/evans\u003e\n* gRPCurl: Like cURL, but for gRPC https://github.com/fullstorydev/grpcurl\n* grpcui: web UI for gRPC https://github.com/fullstorydev/grpcui\n* xDS-Based Global Load Balancing: https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md\n* Stop Breaking the Proto! Designing for Change in Microservices World https://www.youtube.com/watch?v=hbxOO2wnA1Y\u0026list=PLj6h78yzYM2NN72UX_fdmc5CZI-D5qfJL\u0026index=13\n* Practical API Design at Netflix, Part 1: Using Protobuf FieldMask: https://netflixtechblog.com/practical-api-design-at-netflix-part-1-using-protobuf-fieldmask-35cfdc606518\n* Protobuf Field Masks: https://pinkiepractices.com/posts/protobuf-field-masks/\n* protoc-gen-doc: Documentation generator plugin for Google Protocol Buffers https://github.com/pseudomuto/protoc-gen-doc\n* Various gRPC benchmarks: https://github.com/LesnyRumcajs/grpc_bench/wiki\n* Spring WebFlux and gRPC: https://alexbryksin.medium.com/spring-webflux-and-grpc-cda3cabfaba8\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Freactive-grpc-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Freactive-grpc-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Freactive-grpc-demo/lists"}