// The greeting service definition.serviceGreeter{// Sends a greetingrpcSayHello(HelloRequest)returns(HelloReply){}}// The request message containing the user's name.messageHelloRequest{stringname=1;}// The response message containing the greetingsmessageHelloReply{stringmessage=1;}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003egRPC, a high-performance RPC framework developed by Google, allows client applications to directly call methods on a server application as if it were a local object.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints for gRPC utilizes the Extensible Service Proxy (ESP) or Extensible Service Proxy V2 (ESPv2) to provide API management capabilities such as monitoring, authentication, and tracing for gRPC services.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints offers protocol translation, enabling clients to communicate with gRPC services using HTTP/JSON through ESP or ESPv2, which facilitates integration with systems that do not natively support gRPC.\u003c/p\u003e\n"],["\u003cp\u003egRPC services in Endpoints are configured using service definition files and a service configuration file, allowing users to customize runtime behaviors, API mappings, and Cloud Endpoints settings.\u003c/p\u003e\n"],["\u003cp\u003eWhile Endpoints provides robust gRPC support, it currently does not support payload compression or IDLs other than protocol buffers, and it is limited to GKE, Compute Engine, and Cloud Run compute platforms.\u003c/p\u003e\n"]]],[],null,["# Cloud Endpoints for gRPC\n\n[gRPC](http://www.grpc.io) is a high performance, open-source universal RPC\nframework, developed by Google. In gRPC, a client application can directly call\nmethods on a server application on a different machine as if it was a local\nobject, making it easier to create distributed applications and services.\n\nAPI management\n--------------\n\nEndpoints works with either the\n[Extensible Service Proxy (ESP)](/endpoints/docs/grpc/glossary#extensible_service_proxy) or the [Extensible Service Proxy V2](/endpoints/docs/openapi/glossary#extensible_service_proxy_v2) (ESPv2) to provide API management.\n\nWith Endpoints for gRPC, you can use the API management\ncapabilities of Endpoints to add an API console, monitoring,\nhosting, tracing, authentication, and more to your gRPC services. In addition,\nonce you specify special mapping rules, ESP and ESPv2 translate RESTful JSON over HTTP\ninto gRPC requests. This means that you can deploy a gRPC server managed by\nEndpoints and call its API using a gRPC or JSON/HTTP client,\ngiving you much more flexibility and ease of integration with other systems.\n\nYou can create gRPC services for Endpoints in any\ngRPC-supported language. You can find out much more about gRPC,\nincluding quickstarts and tutorials for creating servers and clients, on the\n[gRPC site](http://www.grpc.io/docs/).\n\nSupported compute platforms\n---------------------------\n\nESP and ESPv2 are Open Source projects and are available to you in the following ways:\n\n- A container in Artifact Registry.\n - See the [ESP release notes](https://github.com/cloudendpoints/esp/releases) for the current ESP Docker image.\n - See the [ESPv2 release notes](https://github.com/GoogleCloudPlatform/esp-v2/releases) for the current ESPv2 Docker image.\n- Source code in GitHub.\n - See the [ESP README](https://github.com/cloudendpoints/esp/blob/master/README.md) for details on building ESP.\n - See the [ESPv2 README](https://github.com/GoogleCloudPlatform/esp-v2/blob/master/README.md) for details on building ESPv2.\n\nYou can run the ESP container on the following:\n\n- Compute Engine with Docker\n- Kubernetes, including Google Kubernetes Engine\n- A [Linux or macOS computer or another cloud provider](/endpoints/docs/grpc/running-esp-localdev)\n\nYou can run the ESPv2 container on the following:\n\n- Cloud Run\n- Knative serving\n- GKE\n- Compute Engine\n- Kubernetes\n\nSee [About Cloud Endpoints](/endpoints/docs/grpc/about-cloud-endpoints) for more.\n\nSee [Deploying the API Backend](/endpoints/docs/grpc/deploy-api-backend) for\ninformation on deploying your API and Extensible Service Proxy on Google Cloud compute platforms.\n\nService definition and configuration\n------------------------------------\n\ngRPC is based around the idea of defining a **service** , specifying the methods\nthat can be called remotely with their parameters and return types. By default,\ngRPC uses [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview)\nas the Interface Definition Language (IDL) for describing both the service\ninterface and the structure of the payload messages. \n\n // The greeting service definition.\n service Greeter {\n // Sends a greeting\n rpc SayHello (HelloRequest) returns (HelloReply) {}\n }\n\n // The request message containing the user's name.\n message HelloRequest {\n string name = 1;\n }\n\n // The response message containing the greetings\n message HelloReply {\n string message = 1;\n }\n\nTo use gRPC with Endpoints, you must provide a\n[service configuration](/endpoints/docs/grpc/grpc-service-config)\nalong with the service definition. This configures the runtime\nbehavior of your service, including authentication, the API(s) included in the\nservice, mappings from HTTP requests to gRPC methods, and special Cloud\nEndpoints settings.\n\nTranscoding\n-----------\n\nEndpoints provides protocol translation for your gRPC services\nallowing clients to use HTTP/JSON to communicate with a gRPC service through the ESP or ESPv2.\n\nThe most common use case is allowing browser clients to talk to gRPC servers\nwithout special support from gRPC client libraries. Endpoints\nprovides a mechanism for mapping HTTP requests to gRPC methods as part of\n[service configuration](/endpoints/docs/grpc/grpc-service-config).\n\nYou can find out more about this in [Transcoding HTTP/JSON to gRPC](/endpoints/docs/grpc/transcoding).\n\nLimitations\n-----------\n\nThe following gRPC features are not yet supported in Endpoints:\n\n- Payload compression\n- Any IDL other than protocol buffers\n\nIn addition, Endpoints only supports gRPC services for GKE, Compute Engine, and Cloud Run (Beta). Endpoints does **not** support gRPC services for App Engine environments.\n\nWhat's next?\n------------\n\n- Follow one of our [tutorials](/endpoints/docs/grpc/tutorials) to get a simple gRPC service up and running with Cloud Endpoints in your environment of choice\n- Find out how to [configure a gRPC service](/endpoints/docs/grpc/grpc-service-config) for Cloud Endpoints\n- Explore samples. The getting-started-grpc sample is available on GitHub in the following languages:\n - [Java](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/endpoints/getting-started-grpc)\n - [Python](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/endpoints/getting-started-grpc)\n - [Ruby](https://github.com/GoogleCloudPlatform/ruby-docs-samples/tree/master/endpoints/getting-started-grpc)\n - [Go](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/endpoints/getting-started-grpc)\n - [Node.js](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/endpoints/getting-started-grpc)\n- The Bookstore sample is available in the following languages:\n - [Python](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/endpoints/bookstore-grpc)\n - [Java](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/endpoints)"]]