We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description:
Check the following proto definition.
syntax = "proto3"; import "google/protobuf/empty.proto"; service Store { rpc getAlbums(google.protobuf.Empty) returns (stream Album); rpc storeAlbum(Album) returns (Album); } message Album { string id = 1; string title = 2; string artist = 3; float price = 4; };
When I generate the stub using CLI, the generated stub does not contain the ContextAlbumStream definition.
ContextAlbumStream
$ bal grpc --input record_store.proto $ bal build temp/record_store_pb.bal Compiling source record_store_pb.bal ERROR [record_store_pb.bal:(51:57,51:75)] unknown type 'ContextAlbumStream' ERROR [record_store_pb.bal:(57:26,57:70)] incompatible types: expected 'other', found 'stream<Album,ballerina/grpc:1.2.0:Error?>'
However, when I re-organize the RPCs as below (i.e., make server streaming as the second definition), it works fine.
syntax = "proto3"; import "google/protobuf/empty.proto"; service Store { rpc storeAlbum(Album) returns (Album); rpc getAlbums(google.protobuf.Empty) returns (stream Album); // Change the order } message Album { string id = 1; string title = 2; string artist = 3; float price = 4; };
$ bal grpc --input record_store.proto $ bal build temp/record_store_pb.bal Compiling source record_store_pb.bal Generating executable record_store_pb.jar
The workaround to prevent this issue would be to re-organize RPCs as in Case 02.
Case 02
Affected Versions: SL GA
OS, DB, other environment details and versions:
The text was updated successfully, but these errors were encountered:
madhukaw
Successfully merging a pull request may close this issue.
Description:
Case 01
Check the following proto definition.
When I generate the stub using CLI, the generated stub does not contain the
ContextAlbumStream
definition.Case 02
However, when I re-organize the RPCs as below (i.e., make server streaming as the second definition), it works fine.
$ bal grpc --input record_store.proto $ bal build temp/record_store_pb.bal Compiling source record_store_pb.bal Generating executable record_store_pb.jar
The workaround to prevent this issue would be to re-organize RPCs as in
Case 02
.Affected Versions:
SL GA
OS, DB, other environment details and versions:
The text was updated successfully, but these errors were encountered: