Questions tagged [proto3]

Protocol Buffers - Google's data interchange format

Google Protocol Buffers questions related to version 3 of the Protocol Buffer format should be tagged with this tag.

At this time proto3 is still in alpha stage.

About Versioning

When protobuf was initially opensourced it implemented Protocol Buffers language version 2 (aka proto2), which is why the version number started from v2.0.0. From v3.0.0, a new language version (proto3) is introduced while the old version (proto2) will continue to be supported.

146 questions
2
votes
0 answers

How to use Hive 2.4.6 to read protobuf encoded sequence file

I have a sequence file that value is proto3 encoded byte array. I looked into elephant-bird, which is very old and only support proto 2.x version. https://github.com/kevinweil/elephant-bird Also it stops releasing new package and the latest one is…
2
votes
0 answers

Node gRPC (proto3) how to convert AsObject type back to gRPC class

I'm using node to communicate with a gRPC server, here is an example of generated request ts export class GetUserByFQDNRequest extends jspb.Message { getEnvironmentId(): string; setEnvironmentId(value: string): void; getFqdn():…
Or Yaacov
  • 3,597
  • 5
  • 25
  • 49
2
votes
2 answers

How to determine the value type of proto3's oneof field?

syntax = "proto3"; package gRPC_Forecaster; import "google/protobuf/timestamp.proto"; service Forecaster { rpc Forecast (ProductToForecast) returns (ForecastData) {} } message ProductToForecast { int32 productID = 1; …
Lloen
  • 68
  • 4
  • 11
2
votes
0 answers

How to generate a map of string slices from protobuf file?

As the protocol-buffers documentation describes: Each map field generates a field in the struct of type map[TKey]TValue where TKey is the field's key type and TValue is the field's value type... I would like to set TValue to be a slice of…
Tim
  • 1,585
  • 1
  • 18
  • 23
2
votes
1 answer

Protobuf message / enum type rename and wire compatibility?

Is it (practically) possible to change the type name of a protobuf message type (or enum) without breaking communications? Obviously the using code would need to be adpated to re-compile. The question is if old clients that use the same structure,…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
2
votes
1 answer

gRPC: How to call a remote procedure with combination of static and stream parameters?

I'm trying to transfer a file using gRPC. I can send the data, broken into chunks, using gRPC stream. I'm looking for way to also transfer the filename with the data. I'm sure there is an obvious solution that I'm missing. But here are a few…
2
votes
1 answer

Is it possible to check enum value in proto file?

I would like to validate enum values in generated Java code. I have following proto file: syntax = "proto3"; import "google/protobuf/empty.proto"; option java_multiple_files = true; option java_package = "com.package"; package…
2
votes
1 answer

Is change of a message type to a similar will break backward compatibility?

I want to preserve my application from future issues with backward compatibility. Now I have this version of test.proto: syntax = "proto3"; service TestApi { rpc DeleteFoo(DeleteFooIn) returns (BoolResult) {} rpc DeleteBar(DeleteBarIn)…
2
votes
1 answer

Common proto3 fields with oneof or aggregation

I have to produce a proto class for an object which will have around 12 variations. All 12 variations share four fields which are the same, and then have specific fields. In most cases there will be many more non specific fields than there are…
dahui
  • 2,128
  • 2
  • 21
  • 40
2
votes
1 answer

How to persuade GetProto to spit out proto3 format

Using the excellent ProtobufNet by Marc Gravell, we are able to maintain our types in C# and then export them to .proto files for conversion into all the languages needed by our clients. However we would like to use the proto3 protocol format which…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
2
votes
1 answer

protobuf : define a parentS <-> childrenS relationship

How do I define a parentS <-> childrenS relationship in proto syntax = "proto3"; message Root { repeated Category category = 2; } message Category { string name = 2; repeated Category parent = 3; } The key here is that I want to…
MUH Mobile Inc.
  • 1,462
  • 1
  • 16
  • 25
2
votes
1 answer

How to define com.google.protobuf.Message as message type in .proto file

How to define generic message in proto file. Eg : message GenericResponse { bool status = 1; Foo foo= 2; Bar bar = 3; Baz baz = 4; } Instead of above mentioned protocol I need following protocol. message GenericResponse { bool…
Prasath
  • 1,233
  • 2
  • 16
  • 38
2
votes
2 answers

Add metadata to fields in proto3 for Java

Proto3 has been simplified such that the required and optional fields are no longer supported (See Why required and optional is removed in Protocol Buffers 3). Is there still a way to label a certain field as required? I've looked into FieldOptions,…
Julius Delfino
  • 991
  • 10
  • 27
2
votes
1 answer

Decoding message in protocol buffers php

I'm getting a protobuf message (syntax 2) from another server in c++ and in another server in php, i'm receiving the same protobuf message(syntax 3). Now my purpose is to decode that message. Below are the files: The .proto…
Fisnik Hajredini
  • 111
  • 5
  • 13
2
votes
0 answers

Java classes generated by proto compiler fail to build

I have a simple .proto file, from which I generate java classes. The proto file look like this. message Address { string city = 1; string country = 2; } message PersonalInfo { string name = 1; repeated Address adresses = 2; } The…
safyia
  • 190
  • 2
  • 11