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 asExample
. - The name of the rpc interface is
Echo
, with the input parameter asEchoRequest
, and the output parameter asEchoResponse
. EchoRequest
consists of two strings:message
andname
.EchoResponse
consists of one string:message
.
syntax="proto2";
message EchoRequest {
optional string message = 1;
optional string name = 2;
};
message EchoResponse {
optional string message = 1;
};
service Example {
rpc Echo(EchoRequest) returns (EchoResponse);
};