Running a gRPC based Java Client Server applications in Java. I was able to generate stubs for servers but when it comes intra-service communication, I'm unable to generate stubs for the client application that happens to be a war file running in wildfly. Here's the overview.
Server -> Products (Jar running in a container)
Client -> A War file running on Wildfly
Client is exposing a rest endpoint that in turns call Server.
My understanding is that I should share the proto file between 1 & 2. Following proto is copied both to 1 and 2 under src/main/proto
service ProductService {
rpc findAll(google.protobuf.Empty) returns (Product);
}
message Product {
string id = 1;
string name = 2;
}
Question. Is my understand correct to share the protocol file between two isolated applications and then communicate between the two via generated stubs.