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
1
vote
0 answers

Can't deserialize protobuf encoded by scalapb

i'm trying to encode protobuf object (prepared by scalapb) and pass it to another service written in python (I think, it's doesn't matter, but I'm using NATS.io as messaging system). val protoMsg: ProtoMessage = ProtoMessage(foo = "21266894", bar =…
1
vote
1 answer

Generate file descriptor set (.desc) with scalapb

I am using scalapb in a project that needs to have access to the FileDescriptorSet. Is there a way to have scalapb generate the .desc file in addition to all other class files? Or is there some programatic way of obtaining a FileDescriptorSet from…
James Matlik
  • 185
  • 2
  • 8
1
vote
1 answer

how to start server/client grpc using scalapb on spark?

i have a problem about running server/client using ScalaPB on spark. its totally work fine while I running my code using "sbt run". i want running this code using spark coz next ill import my spark model to predict some label. but while I submit my…
user9714409
1
vote
1 answer

Scala code generates type mismatch (ScalaPB)

I have a protobuf file ... which I transform to a Scala file using ScalaPB. This way I can then ... use it inside my Juypter notebook* for transformation. Sadly, when I ... run the specific cell I get an type mismatch error and I don't know…
lony
  • 6,733
  • 11
  • 60
  • 92
1
vote
1 answer

Unknown fields in proto generated by scalapb

I'm new to scalapb and protobuf. I'm trying to create unit test for my scalapb's generators. I've generated proto files and trying to use them in tests. I've got this proto file: syntax = "proto3"; package hellogrpc.calc; import…
Alexander Kondaurov
  • 3,677
  • 5
  • 42
  • 64
1
vote
1 answer

Any way to move ScalaProtobuf plugin's clean task out of main "sbt clean" task?

I am using the this scala protobuf plugin: https://scalapb.github.io/ I 'm having a problem where every time I run "sbt clean", the generated protobuf files are also cleaned. Is there any way I can Configured the plugin so that scalapb's clean task…
Marlon Ou
  • 471
  • 1
  • 6
  • 19
1
vote
1 answer

Improve Protobuf Performance using Any type

Does using the protobuf Any time improve performance? Currently, I have a couple of services that just pass data through without doing any transformations. Would using the Any type save on cpu cycles spent serializing/deserializing data?
pradyuman
  • 1,089
  • 2
  • 14
  • 20
1
vote
1 answer

missing FromRequestUnmarshaller[Entity] on akka post route

Let me start by saying that i am very new to akka-http, none of the books i have covered the marsheling topic well. So it is bit of a blackbox for me. I was able to obtain the following (Un)Marsheller which is capable of returning both json and…
DevZer0
  • 13,433
  • 7
  • 27
  • 51
1
vote
1 answer

How to send and receive protobuf messages over Akka Tcp

I'm using ScalaPB for my protobuf compiler which generates Scala case classes, parsers and serializers for my protocol buffers. I have a simple protobuf message in a .proto file that has been compiled to a Scala case class thanks to ScalaPB. option…
Edward Maxedon
  • 1,151
  • 2
  • 11
  • 17
0
votes
0 answers

Is there a way to prevent scalapb auto-generation for certain gRPC endpoints in a service?

We have a large gRPC service that contains many endpoints. When we try to add a new endpoint, compilation of the scala code generated by scalapb fails, because the bindService method in the service implementation is too large. Because many endpoints…
0
votes
2 answers

How to create a jar file for Gatling gRPC Load test with only test class

I am using the code from https://github.com/alexromanov/gatling-grpc-tests-sample i have added new protobuf under src/main and added a newSimulation.scala under src/test/scala/load. The code works fine and able to run. Now the problem i want a jar…
sivadas j
  • 41
  • 3
0
votes
1 answer

Scala Protocol Buffer and Maven issues

My requirment is use Protocol Buffer on the Scala Play! REST API project and I'm having a hard time adding it. I followed the instructions in the documentation but it keeps failing. This is how it looks like: my build.sbt scalaVersion :=…
0
votes
1 answer

Map a Scala code generated by the Protocol Buffer Compiler from a .proto file to a simple scala case class

Is there a library out there to map a Scala code generated by the Protocol Buffer Compiler from a .proto file to a simple scala case class. The big file doesnt have a mapper fiunction Example of Scala code generated by the Protocol Buffer Compiler…
Freez
  • 53
  • 9
0
votes
1 answer

How to parse arbitrary protobuf message in scala usind scalapb

According to the documentation scalapb is able to parse arbitrary protobuf messages into json format. However, I cannot make heads or tails of their documentation and my code simply does not compile: // apparently the Companion Object provides the…
Sim
  • 4,199
  • 4
  • 39
  • 77
0
votes
0 answers

java.nio.channels.UnsupportedAddressTypeException

I'm building a test gRPC server with Mill using ScalaPBModule. I can successfully build (with server.assembly) and start the server, but when it is hit with a request, the client throws this error: Suppressed:…