Updated RPC signature of service

38 views
Skip to first unread message

Robert Bielik

unread,
Dec 4, 2017, 7:42:43 AM12/4/17
to grpc.io
Hi all,

As an update to a service we had, the signature of an RPC changed, from a non-streamed to a server side streaming RPC like so:

rpc StartProcess(ProcessData) returns (VoidMessage); // Version 1

and now it is:

rpc StartProcess(ProcessData) returns (stream Progress); // Version 2

Is there a way I can on the client side (C++ btw) check to see which signature of the RPC that the server implements ? I imagine that
if I call the RPC with the wrong signature, I would get a grpc::StatusCode::UNIMPLEMENTED ?

Regards
/Robert

Carl Mastrangelo

unread,
Dec 5, 2017, 6:59:13 PM12/5/17
to grpc.io
You can use server reflection to query what APIs it supposed.  Its a service that needs to be added to your server at the moment, but eventually it will be on by default.

Eric Anderson

unread,
Dec 6, 2017, 9:03:11 AM12/6/17
to Robert Bielik, grpc.io
On Mon, Dec 4, 2017 at 6:42 AM, Robert Bielik <robert...@gmail.com> wrote:
Is there a way I can on the client side (C++ btw) check to see which signature of the RPC that the server implements ? I imagine that
if I call the RPC with the wrong signature, I would get a grpc::StatusCode::UNIMPLEMENTED ?

Streaming uses the same basic format as non-streaming; it just has more messages. So if I assume how this looks based on message names, this actually looks mostly wire-compatible. The biggest problem is the return type changed. That may be fine too, assuming your VoidMessage has no fields like google.protobuf.Empty, and a no-fields-set Progress is semi-valid.
Reply all
Reply to author
Forward
0 new messages