ballerina-guides/gcp-microservices-demo

Generated Ballerina gRPC remote method names do not follow Ballerina naming conventions

sameerajayasoma opened this issue · 3 comments

Here is an example from the ad service:

remote function GetAds(AdRequest request) returns AdResponse|error {}

Corresponding proto file definition:

service AdService {
    rpc GetAds(AdRequest) returns (AdResponse) {}
}

The above service definition is written according to the protobuf style guide: https://developers.google.com/protocol-buffers/docs/style.

But when we generate these protobuf definitions for the target language, we should follow the naming conventions of that language. See: https://grpc.io/docs/languages/java/quickstart/

@daneshk, is this a limitation in our gRPC tool?

Yes, this is a limitation in our gRPC tooling. we generate the method name the same as it is defined in the protoc file. and also validate the names at service registration. We have an issue[1]. We will check

  1. ballerina-platform/ballerina-library#2705

This is a breaking change on the client side. we also need to change the remote functions in the client stub file. Anyone who regenerates the client stubs has to change the function calls.

Closing this issue in demo repo as an issue for the grpc tool is already created.