Questions tagged [protobuf-java]

289 questions
2
votes
1 answer

Sharing Proto or Generated Files across Microservices

I am building a Spring Boot Microservices using protobuf and gRPC for communication. However, I realised that I will need to define the entities in all microservices that requires it. Instead of the straight forward method of copy and paste the raw…
WeiTang Lau
  • 103
  • 1
  • 11
2
votes
1 answer

How to Generate Protobuf documentation?

Does anyone know of a good tool to generate Google Protobuf documentation using the .proto source files? The documentation generated from the below source is excellent. https://github.com/pseudomuto/protoc-gen-doc But, being a java developer, I am…
2
votes
1 answer

How to deserialize a protobuf bytearray to java object

New to protobuf, need your kind advice please. I have a JMS subscriber which is receiving a message (Type -> com.tibco.tibjmsTibjmsBytesMessage) from a TIBCO queue. The messages have been published as Protobuf bytes message on the queue. As as…
2
votes
0 answers

How to receive a protobuf message via RabbitMQ with Spring Integration?

I try to receive a protobuf message out of RabbitMQ using Spring Integration. My integration flow: public class FacadeIntegrationFlowAdapter extends IntegrationFlowAdapter { @SuppressWarnings("rawtypes") private final Facade facade; private…
2
votes
0 answers

Is it possible force save zero integer values with Protocol Buffers in Java?

I'm using Protocol Buffers from Google in my Java projects. When I define message like that: message Event { int32 action = 1; } and save value zero as an action, then value zero won't be saved. It's able to save all integer values except for…
Piotr Wittchen
  • 3,853
  • 4
  • 26
  • 39
2
votes
1 answer

In protobuf can I constrain a map's key to certain values?

So protobuf does not allow string enums to be keys in a map I want to constrain a map to only have the keys a, b, or c. I'm working in Kotlin and can use validators like [(validate.rules).string = {pattern: "^a|b|c$"}] message payload { …
spacether
  • 2,136
  • 1
  • 21
  • 28
2
votes
0 answers

Java 9 modules - 3rd party library dependency conflict

Does Java 9 modules can help with solving dependency conflict? I have included two dependencies, protobuf-java and protobuf-lite, they both contains the same classes under the same packages (FQN), the problem is implementations differs a bit from…
minizibi
  • 363
  • 2
  • 14
2
votes
1 answer

"package io.grpc does not exist" and "static import only from classes and interfaces" when trying to generate Java Protobuf code

I'm trying to follow along this blog post, https://redbyte.eu/en/blog/calling-java-from-go-using-grpc/, in this repository, https://github.com/khpeek/pdf-parser. After running ./gradlew build, the project has the following structure: . ├── build │  …
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
2
votes
0 answers

Is it possible to let Orika use an object builder? (Protocol buffers objects)

I'm using protocol buffers, which has a builder. while setting in orika the following: mapperFactory.classMap(TestMSGA.class, TestMSGB.class) .byDefault() .register(); I'm unable to map the objects, some validation…
USer22999299
  • 5,284
  • 9
  • 46
  • 78
2
votes
1 answer

Protobuf-3: How to resolve missing method "getIdCase()" ? Classes generated with '--experimental_allow_proto3_optional '

I used the proto3_optional, and getting this xxCase() method missing on field that are 'optional'. Is there a workaround for this? Generated message class "muni.model.Model$Person" missing method "getIdCase" NoSuchMethodException:…
Espresso
  • 5,378
  • 4
  • 35
  • 66
2
votes
0 answers

Getting the error google/protobuf/descriptor.proto: File not found. on moving to protobuf javalite from protobuf java

Below is what code I have added in my gradle file to solve duplicate GeneratedMessageLite class issue in protobuf upon which I am getting the error: Cause: protoc: stdout: . stderr: google/protobuf/descriptor.proto: File not…
2
votes
0 answers

Enums with some properties in protobuf

In java, we can define enums with some properties inside it like - public enum Enum1{ A1(true, 1, "A1"), B1(false,2,"B1"); private boolean isTrue; private int index; private String name; public Enum1(boolean isTrue, int…
Rahul Vedpathak
  • 1,346
  • 3
  • 16
  • 30
2
votes
0 answers

How to compare google protobuf ByteString

In google protobuf, it provides a type called ByteString, I checked the doc: https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/ByteString there is no comparison method for use. Let's say: List
2
votes
1 answer

Smallest way to save java int[] with protocol buffer 3?

I have an complex object that holds million of int int[] ints = new int[1000000] If I save that values directly via ByteBuffer it's file size is about 5MB When I save that values to protocol buffer object, It save each value not as int but as…
Jihun No
  • 1,201
  • 1
  • 14
  • 29
2
votes
2 answers

Execution failed for task ':app:mergeExtDexXXXDebug'

I am using Android Studio 3.5, gradle-5.4.1-all.zip, com.android.tools.build:gradle:3.5.0, org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50 I got error when i rebuild project: What went wrong: Execution failed for task…
ThanmaDW
  • 89
  • 1
  • 2
  • 9