I have two java projects that produce and consume messages from Kafka,
one project produces a message of type Ticker and another project consumes this message.
So I've created this file
syntax = "proto3";
message Ticker {
string symbol = 1;
float ask = 2;
float bid = 3;
}
I know that in order to create Java objects for this message type, I use protoc
However, I have two problems.
I need a way of sharing the
protofile across the project (the 2 projects that I have right now and any future project that would need access toTicker). What is the best way to do it? I've heard something about git subtrees or submodules, is it a good/reliable way?I need a way for
protocto generate the Java objects under some package, for a example, I have two projects, one iscom.myorg.TickerProducerand another one iscom.myorg.TickerConsumerI needprotocto generate the Java objects in the packages/namespacescom.myorg.TickerProducer.Entitiesandcom.myorg.TickerConsumer.Entitiesrespectively. I know that I can useoption java_packageinside theprotofile, but I have different projects that use the same files and each want the Java objects to be generated under their namespaces. Is there a way to do it?
Thank you.