Skip to content
Advertisement

Tag: protocol-buffers

Difference between a DynamicMessage and a typed Message

I’m trying to understand more about protobuf DynamicMessage. If I have a message Animal that is coming from an input stream, code that has the Animal protoc java type (say AnimalProto) will use that type directly to deserialize. Whereas a code without the compile time dependency on AnimalProto but has access to the Type descriptor will use that Type descriptor

proto3: Why setting java_multiple_files = true not creating separate java classes for each proto message?

I have a proto definition with nested classes When I generate the java classes with option java_multiple_files = false; it creates a single java class, ClusterConfigOuterClass.java with all the Java classes/enums/etc generated for the top-level messages, services, and enumerations nested inside it. This is expected. But if I use option java_multiple_files = true; then I am seeing it is generating

How to use org.springframework.messaging.converter.ProtobufMessageConverter

I was trying to use Spring framework built-in ProtobufMessageConverter to convert my kafka message but I couldn’t seem to find a way to have this converter being used. The configuration of my binding is as the following: When I use my custom message converter, I can see it registered in SimpleFunctionRegistry.messageConverter which is a list of customer converter and default

Protobuf repeated fields to json array mapping

I’m using Java, Spring-boot, Hibernate stack and protocol buffers as DTO for communication among micro-services. At reverse proxy, I convert the protobuf object to json using protobuf’s java support. I have the following structure Converting the MultipleItems DTO to json gives me the following result: In the generated json, I’ve got the key items that maps to the json array.

How to specify the Protobuf path using protobuf-gradle-plugin

I’m trying to generate Protobufs in a Java project that are defined in another Git repository that I’d like to add as a Git submodule. My build.gradle contains and I’ve included the protobufs repository (called my-protobufs) in the src/main/proto directory. The Protobufs are in turn located in a proto subdirectory of my-protobufs. A partial directory structure looks like this: The

Generic getDefaultInstance() for java protobuf

I’m trying to write a static util function that takes in a protobuf object and determine if it’s a default instance, something along the line of: Would like for it to be able to apply to a range of protobuf objects like Struct / Types / Messages, however getDefaultInstance() appears to only get defined in the child classes. I’m thinking

Grpc.Core.RpcException method is unimplemented with C# client and Java Server

I am having trouble finding the source of this error. I implemented a simple service using protobuf: When using a java client everything works fine, the server receives the request and responds appropriately. When using C# with the same .proto file for generating sources at the client.Login() I get the following errror: Grpc.Core.RpcException Status(StatusCode=Unimplemented, Detail=”Method tourism.RemoteService/Login is unimplemented”). The server

Advertisement