Skip to content

Make adding a new RPC to .proto file non-breaking for service implementation (server-side) #5371

@jtattermusch

Description

@jtattermusch

Currently, services are implemented by implementing an autogenerated interface (e.g. IMath). When a new RPC is added to to the .proto file, regenerating the code leads to breaking a build, because a new method is added to the serverside stub interface (which is quite natural behavior as such, but can be very undesirable at times).

A remedy would be to auto-generate an FooImplBase (naming TBD) that provides virtual methods with default implementation of all RPC returning just StatusCode.UNIMPLEMENTED.
If service implementation is inherited from the base class mentioned, adding new RPCs to the proto file does no longer break user's code.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions