The grpc API is stable now since 1.0, so distributing generated sources, while not recommended, sound work. But you should consider distributing the proto alongside anyway. Maybe someone wants to communicate with your service in another language than Java?
On Aug 26, 2016 08:10, "Paul Johnston" <[email protected]> wrote: > My opinion, YMMV... > > The service abstraction is already captured by the proto3 file A.proto, so > I would either: > > 1. distribute no implementation (just the A.proto) > 2. everything (A.jar with transitive deps). > > If you just distribute the proto file (my preferred choice), your client B > can generate the stub implementation for it's environment. > > You may be able to get away with your current setup, but it sounds brittle. > > On Friday, August 26, 2016 at 8:51:47 AM UTC-6, Mario Steinhoff wrote: >> >> Hey everyone, >> >> I have two Java services A and B. A provides RPC services via gRPC and >> contains a proto file with service and message definitions. Now in B, >> I want to call services from A. >> >> Currently, I am not distributing the proto file but compile the proto >> file into Java classes and create a JAR file in the service A build. >> The JAR file gets publishes to my internal artifact repository but >> without grpc-stub and grpc-protobuf transitive dependencies >> (compileOnly). The calling service includes gRPC and the jar file with >> the compile classes and then creates a ManagedChannel and a stub for >> the xxxGrpc service. >> >> It works for now, but is this a good idea? Would it be possible to >> update gRPC in the calling service or might this break APIs and I have >> to recompile the JAR file in the providing service? >> >> Another way I could think of is to put the proto file into a JAR file >> and add the JAR file to dependencies in all calling services. Then I'd >> have to compile protobuf classes in each calling service but the gRPC >> versions in both services are fully independent. >> >> Whats the recommended way of doing this? >> >> Mario >> > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/grpc-io/f109acf1-3e34-45c5-a2a5-e65c9979e346%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/f109acf1-3e34-45c5-a2a5-e65c9979e346%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAEvr0PESprS0xXqpkmfEB3K6ToddWvH4igdXS3%2BrL8iqmEzBaw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
