{"id":13470427,"url":"https://github.com/grpc/grpc-java","last_synced_at":"2025-05-12T16:08:41.039Z","repository":{"id":24332624,"uuid":"27729926","full_name":"grpc/grpc-java","owner":"grpc","description":"The Java gRPC implementation. HTTP/2 based RPC","archived":false,"fork":false,"pushed_at":"2025-05-05T13:51:49.000Z","size":106103,"stargazers_count":11712,"open_issues_count":493,"forks_count":3889,"subscribers_count":522,"default_branch":"master","last_synced_at":"2025-05-05T14:09:22.268Z","etag":null,"topics":["grpc","java","microservices","proto","rpc"],"latest_commit_sha":null,"homepage":"https://grpc.io/docs/languages/java/","language":"Java","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/grpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-12-08T19:00:00.000Z","updated_at":"2025-05-05T13:14:52.000Z","dependencies_parsed_at":"2024-03-22T23:41:41.352Z","dependency_job_id":"3b6731bb-a68b-4373-a873-ddfcc353819e","html_url":"https://github.com/grpc/grpc-java","commit_stats":{"total_commits":6520,"total_committers":410,"mean_commits":"15.902439024390244","dds":0.7486196319018406,"last_synced_commit":"921f88ae30e5a4b1d890f3ea7ff709f475a86298"},"previous_names":[],"tags_count":183,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grpc%2Fgrpc-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grpc%2Fgrpc-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grpc%2Fgrpc-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grpc%2Fgrpc-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grpc","download_url":"https://codeload.github.com/grpc/grpc-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253773915,"owners_count":21962194,"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","java","microservices","proto","rpc"],"created_at":"2024-07-31T16:00:30.111Z","updated_at":"2025-05-12T16:08:41.026Z","avatar_url":"https://github.com/grpc.png","language":"Java","readme":"gRPC-Java - An RPC library and framework\n========================================\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eHomepage:\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://grpc.io/\"\u003egrpc.io\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003eMailing List:\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://groups.google.com/forum/#!forum/grpc-io\"\u003egrpc-io@googlegroups.com\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n[![Join the chat at https://gitter.im/grpc/grpc](https://badges.gitter.im/grpc/grpc.svg)](https://gitter.im/grpc/grpc?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![GitHub Actions Linux Testing](https://github.com/grpc/grpc-java/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/grpc/grpc-java/actions/workflows/testing.yml?branch=master)\n[![Line Coverage Status](https://coveralls.io/repos/grpc/grpc-java/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/grpc/grpc-java?branch=master)\n[![Branch-adjusted Line Coverage Status](https://codecov.io/gh/grpc/grpc-java/branch/master/graph/badge.svg)](https://codecov.io/gh/grpc/grpc-java)\n\nSupported Platforms\n-------------------\n\ngRPC-Java supports Java 8 and later. Android minSdkVersion 21 (Lollipop) and\nlater are supported with [Java 8 language desugaring][android-java-8].\n\nTLS usage on Android typically requires Play Services Dynamic Security Provider.\nPlease see the [Security Readme](SECURITY.md).\n\nOlder Java versions are not directly supported, but a branch remains available\nfor fixes and releases. See [gRFC P5 JDK Version Support\nPolicy][P5-jdk-version-support].\n\nJava version | gRPC Branch\n------------ | -----------\n7            | 1.41.x\n\n[android-java-8]: https://developer.android.com/studio/write/java8-support#supported_features\n[P5-jdk-version-support]: https://github.com/grpc/proposal/blob/master/P5-jdk-version-support.md#proposal\n\nGetting Started\n---------------\n\nFor a guided tour, take a look at the [quick start\nguide](https://grpc.io/docs/languages/java/quickstart) or the more explanatory [gRPC\nbasics](https://grpc.io/docs/languages/java/basics).\n\nThe [examples](https://github.com/grpc/grpc-java/tree/v1.72.0/examples) and the\n[Android example](https://github.com/grpc/grpc-java/tree/v1.72.0/examples/android)\nare standalone projects that showcase the usage of gRPC.\n\nDownload\n--------\n\nDownload [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.grpc\u003c/groupId\u003e\n  \u003cartifactId\u003egrpc-netty-shaded\u003c/artifactId\u003e\n  \u003cversion\u003e1.72.0\u003c/version\u003e\n  \u003cscope\u003eruntime\u003c/scope\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.grpc\u003c/groupId\u003e\n  \u003cartifactId\u003egrpc-protobuf\u003c/artifactId\u003e\n  \u003cversion\u003e1.72.0\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.grpc\u003c/groupId\u003e\n  \u003cartifactId\u003egrpc-stub\u003c/artifactId\u003e\n  \u003cversion\u003e1.72.0\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e \u003c!-- necessary for Java 9+ --\u003e\n  \u003cgroupId\u003eorg.apache.tomcat\u003c/groupId\u003e\n  \u003cartifactId\u003eannotations-api\u003c/artifactId\u003e\n  \u003cversion\u003e6.0.53\u003c/version\u003e\n  \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nOr for Gradle with non-Android, add to your dependencies:\n```gradle\nruntimeOnly 'io.grpc:grpc-netty-shaded:1.72.0'\nimplementation 'io.grpc:grpc-protobuf:1.72.0'\nimplementation 'io.grpc:grpc-stub:1.72.0'\ncompileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+\n```\n\nFor Android client, use `grpc-okhttp` instead of `grpc-netty-shaded` and\n`grpc-protobuf-lite` instead of `grpc-protobuf`:\n```gradle\nimplementation 'io.grpc:grpc-okhttp:1.72.0'\nimplementation 'io.grpc:grpc-protobuf-lite:1.72.0'\nimplementation 'io.grpc:grpc-stub:1.72.0'\ncompileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+\n```\n\nFor [Bazel](https://bazel.build), you can either\n[use Maven](https://github.com/bazelbuild/rules_jvm_external)\n(with the GAVs from above), or use `@io_grpc_grpc_java//api` et al (see below).\n\n[the JARs]:\nhttps://search.maven.org/search?q=g:io.grpc%20AND%20v:1.72.0\n\nDevelopment snapshots are available in [Sonatypes's snapshot\nrepository](https://oss.sonatype.org/content/repositories/snapshots/).\n\nGenerated Code\n--------------\n\nFor protobuf-based codegen, you can put your proto files in the `src/main/proto`\nand `src/test/proto` directories along with an appropriate plugin.\n\nFor protobuf-based codegen integrated with the Maven build system, you can use\n[protobuf-maven-plugin][] (Eclipse and NetBeans users should also look at\n`os-maven-plugin`'s\n[IDE documentation](https://github.com/trustin/os-maven-plugin#issues-with-eclipse-m2e-or-other-ides)):\n```xml\n\u003cbuild\u003e\n  \u003cextensions\u003e\n    \u003cextension\u003e\n      \u003cgroupId\u003ekr.motd.maven\u003c/groupId\u003e\n      \u003cartifactId\u003eos-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e1.7.1\u003c/version\u003e\n    \u003c/extension\u003e\n  \u003c/extensions\u003e\n  \u003cplugins\u003e\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:3.25.5:exe:${os.detected.classifier}\u003c/protocArtifact\u003e\n        \u003cpluginId\u003egrpc-java\u003c/pluginId\u003e\n        \u003cpluginArtifact\u003eio.grpc:protoc-gen-grpc-java:1.72.0:exe:${os.detected.classifier}\u003c/pluginArtifact\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  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n[protobuf-maven-plugin]: https://www.xolstice.org/protobuf-maven-plugin/\n\nFor non-Android protobuf-based codegen integrated with the Gradle build system,\nyou can use [protobuf-gradle-plugin][]:\n```gradle\nplugins {\n    id 'com.google.protobuf' version '0.9.5'\n}\n\nprotobuf {\n  protoc {\n    artifact = \"com.google.protobuf:protoc:3.25.5\"\n  }\n  plugins {\n    grpc {\n      artifact = 'io.grpc:protoc-gen-grpc-java:1.72.0'\n    }\n  }\n  generateProtoTasks {\n    all()*.plugins {\n      grpc {}\n    }\n  }\n}\n```\n\n[protobuf-gradle-plugin]: https://github.com/google/protobuf-gradle-plugin\n\nThe prebuilt protoc-gen-grpc-java binary uses glibc on Linux. If you are\ncompiling on Alpine Linux, you may want to use the [Alpine grpc-java package][]\nwhich uses musl instead.\n\n[Alpine grpc-java package]: https://pkgs.alpinelinux.org/package/edge/community/x86_64/grpc-java\n\nFor Android protobuf-based codegen integrated with the Gradle build system, also\nuse protobuf-gradle-plugin but specify the 'lite' options:\n\n```gradle\nplugins {\n    id 'com.google.protobuf' version '0.9.5'\n}\n\nprotobuf {\n  protoc {\n    artifact = \"com.google.protobuf:protoc:3.25.5\"\n  }\n  plugins {\n    grpc {\n      artifact = 'io.grpc:protoc-gen-grpc-java:1.72.0'\n    }\n  }\n  generateProtoTasks {\n    all().each { task -\u003e\n      task.builtins {\n        java { option 'lite' }\n      }\n      task.plugins {\n        grpc { option 'lite' }\n      }\n    }\n  }\n}\n\n```\n\nFor [Bazel](https://bazel.build), use the [`proto_library`](https://github.com/bazelbuild/rules_proto)\nand the [`java_proto_library`](https://bazel.build/reference/be/java#java_proto_library) (no `load()` required) \nand `load(\"@io_grpc_grpc_java//:java_grpc_library.bzl\", \"java_grpc_library\")` (from this project), as in\n[this example `BUILD.bazel`](https://github.com/grpc/grpc-java/blob/master/examples/BUILD.bazel).\n\nAPI Stability\n-------------\n\nAPIs annotated with `@Internal` are for internal use by the gRPC library and\nshould not be used by gRPC users. APIs annotated with `@ExperimentalApi` are\nsubject to change in future releases, and library code that other projects\nmay depend on should not use these APIs.\n\nWe recommend using the\n[grpc-java-api-checker](https://github.com/grpc/grpc-java-api-checker)\n(an [Error Prone](https://github.com/google/error-prone) plugin)\nto check for usages of `@ExperimentalApi` and `@Internal` in any library code\nthat depends on gRPC. It may also be used to check for `@Internal` usage or\nunintended `@ExperimentalApi` consumption in non-library code.\n\nHow to Build\n------------\n\nIf you are making changes to gRPC-Java, see the [compiling\ninstructions](COMPILING.md).\n\nHigh-level Components\n---------------------\n\nAt a high level there are three distinct layers to the library: *Stub*,\n*Channel*, and *Transport*.\n\n### Stub\n\nThe Stub layer is what is exposed to most developers and provides type-safe\nbindings to whatever datamodel/IDL/interface you are adapting. gRPC comes with\na [plugin](https://github.com/google/grpc-java/blob/master/compiler) to the\nprotocol-buffers compiler that generates Stub interfaces out of `.proto` files,\nbut bindings to other datamodel/IDL are easy and encouraged.\n\n### Channel\n\nThe Channel layer is an abstraction over Transport handling that is suitable for\ninterception/decoration and exposes more behavior to the application than the\nStub layer. It is intended to be easy for application frameworks to use this\nlayer to address cross-cutting concerns such as logging, monitoring, auth, etc.\n\n### Transport\n\nThe Transport layer does the heavy lifting of putting and taking bytes off the\nwire. The interfaces to it are abstract just enough to allow plugging in of\ndifferent implementations. Note the transport layer API is considered internal\nto gRPC and has weaker API guarantees than the core API under package `io.grpc`.\n\ngRPC comes with multiple Transport implementations:\n\n1. The Netty-based HTTP/2 transport is the main transport implementation based\n   on [Netty](https://netty.io). It is not officially supported on Android.\n   There is a \"grpc-netty-shaded\" version of this transport. It is generally\n   preferred over using the Netty-based transport directly as it requires less\n   dependency management and is easier to upgrade within many applications.\n2. The OkHttp-based HTTP/2 transport is a lightweight transport based on\n   [Okio](https://square.github.io/okio/) and forked low-level parts of\n   [OkHttp](https://square.github.io/okhttp/). It is mainly for use on Android.\n3. The in-process transport is for when a server is in the same process as the\n   client. It is used frequently for testing, while also being safe for\n   production use.\n4. The Binder transport is for Android cross-process communication on a single\n   device.\n","funding_links":[],"categories":["Java","Projects","Official Libraries and Tools","Solutions","网络服务","开发框架","Backend Service","项目","III. Network and Integration","Networking"],"sub_categories":["Networking","网络服务_其他","RPC","联网","2. Networking"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrpc%2Fgrpc-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrpc%2Fgrpc-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrpc%2Fgrpc-java/lists"}