Here is what my proto file looks like :
option java_package = "com.test.report";
message ClientRecord
{
optional string cust_id = 1;
optional double tx_bytes = 2;
optional double rx_bytes = 3;
optional string source_id = 4;
optional string dest_id = 5;
}
message ClientRecords
{
repeated ClientRecord record = 1;
}
I am able to write protobuf generator/decoder in python, but how do I write it in Scala/Java. Can anyone help me to write a generator in Scala for my example?
Check out ScalaPB
More specifically, check out this section which shows an example of how generate a Scala case class for a given proto file. It will generate parsers and serializers as well. Hope this helps you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With