RPC IDL

  • Interface Description Languaue file
  • Backward and forward compatibility
  • Protobuf/Thrift

Sample

You can follow the detailed example below:

  • Take pb as an example. First, define an example.proto file with the ServiceName as Example.
  • The name of the rpc interface is Echo, with the input parameter as EchoRequest, and the output parameter as EchoResponse.
  • EchoRequest consists of two strings: message and name.
  • EchoResponse consists of one string: message.
  1. syntax="proto2";
  2. message EchoRequest {
  3. optional string message = 1;
  4. optional string name = 2;
  5. };
  6. message EchoResponse {
  7. optional string message = 1;
  8. };
  9. service Example {
  10. rpc Echo(EchoRequest) returns (EchoResponse);
  11. };