Questions tagged [scalapb]

ScalaPB is a protocol buffer compiler (protoc) plugin for Scala. It generates Scala case classes, parsers and serializers for protocol buffers.

Main features:

Built on top of Google’s protocol buffer compiler to ensure perfect compatibility with the language specification.

Nested updates are easy by using lenses:

val newOrder = order.update(_.creditCard.expirationYear := 2015)

Generated case classes can co-exist alongside the Java-generated code (the class names will not clash). This allows gradual transition from Java to Scala.

Can optionally generate conversion methods between the Java generated version of Protocol Buffers to the Scala generated version. This makes it possible to migrate your project gradually.

Supports for Oneof’s that were introduced in Protocol Buffers 2.6.0.

Learn more here: https://scalapb.github.io/index.html

Source code: https://github.com/scalapb/ScalaPB

104 questions
0
votes
1 answer

How to created a jar file from the com.trueaccord.scalapb generated sources

I am using ScalapB to generated source code for the protobuf schema. Works great. How do I generate a jar consisting of only the generated source code. I would like to create a jar file and add it as a dependency to Zeppelin Spark Interpreter.
Anna
  • 145
  • 1
  • 8
0
votes
1 answer

scalapb and custom source generator conflict

I wish to add a custom source generator to sbt and use it along with scalapb, the Scala protocol buffer generator. Each works by itself. However when both are combined the project fails to compile the first time after a clean. If I run compile…
chris
  • 2,473
  • 1
  • 29
  • 28
0
votes
0 answers

scalapb isn't returning channel when using plain test

i am trying to build a client using gRpc with scalaPB. According to the documentation I should be able to run the following to create a channel: ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build But when I the build method…
richs
  • 4,699
  • 10
  • 43
  • 56
0
votes
3 answers

Handling loads of different message-types at runtime in an elegant way

In order to be able to handle large amounts of different request types I created a .proto file like this: message Message { string typeId = 1; bytes message = 2; } I added the typeId so that one knows what actual protobuf bytes represents.…
user4063815
0
votes
1 answer

Grouping/identify actor logs for the same "request"

I am looking for a way or best/better design decision for a logging problem. I am using Akka actors in clusters for my back-end services and Play in the front-end to accept HTTP requests. My question is kind of extended from the old question of…
lunaspeed
  • 165
  • 1
  • 11
0
votes
2 answers

How do I access the nested fields in the dataframe .proto, ScalaPB

The following my dataframe schema root |-- name: string (nullable = true) |-- addresses: array (nullable = true) | |-- element: struct (containsNull = true) | | |-- street: string (nullable = true) | | |-- city: string (nullable…
0
votes
2 answers

structured streaming with Spark 2.0.2, Kafka source and scalapb

I am using structured streaming (Spark 2.0.2) to consume kafka messages. Using scalapb, messages in protobuf. I am getting the following error. Please help.. Exception in thread "main" scala.ScalaReflectionException: is not a term at …
shylas
  • 99
  • 4
  • 13
0
votes
1 answer

scalapb-maven-example from https://github.com/aegnor/scalapb-maven-example gives me error

I am trying the run the example from https://github.com/aegnor/scalapb-maven-example and I am getting the following error. [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (generate-scala-protobuf-classes) on project…
shylas
  • 99
  • 4
  • 13
0
votes
1 answer

How to add nested message into already created message ? (in Scala)

After adding nested message i recieve nested messages from main message and got nothing. You can see it in logs: 1 and 2. Size of List 0 ! Any ideas? message PacketPlayers { repeated PacketPlayer players = 1; }
Eldar Nezametdinov
  • 1,917
  • 4
  • 21
  • 23
0
votes
0 answers

ScalaPB not recognized within build.sbt

Following the instructions for scalaPB, I have added the file project/scalapb.sbt to my intelli j project. Here is the file itself addSbtPlugin("com.trueaccord.scalapb" % "sbt-scalapb" % "0.4.20") libraryDependencies ++= Seq( …
TheM00s3
  • 3,677
  • 4
  • 31
  • 65
-1
votes
0 answers

ScalaPB: custom name for a message

I need a custom name for a generated from message case class. ScalaPB has custom names for a field, but I haven't found anything about messages in docs.
LIshy2
  • 150
  • 6
-1
votes
1 answer

How to avoid a copy of array when parsing a ByteString with ScalaPB

Given bs, an instance of com.google.protobuf.ByteString. What is the best way to parse from it I have tried Foo.parseFrom(bs.toByteArray) Foo.parseFrom(bs.newInput) Surprisingly, a JMH benchmark shows that 1. is faster (I would have expected to…
Yann Moisan
  • 8,161
  • 8
  • 47
  • 91
-1
votes
3 answers

Import "google/protobuf/wrappers.proto" was not found scala

I have a .proto file which Imports google/protobuf/wrappers.proto while I run Scalapbc to generate the relevant scala code out of it it gives Import google/protobuf/wrappers.proto not found error. as a workaround for now I have kept the…
san
  • 1
  • 3
1 2 3 4 5 6
7