imrichardcole
imrichardcole

Reputation: 4675

Compatibility between protobuf 2.3.0 and 2.6.0

I'm working with two sets of protobuf bindings, A and B.

A has been generated with protoc version 2.3.0 and B has been generated with protoc version 2.6.0. In my application that uses both of the above I'm using the protobuf-java library version 2.6.0.

With this setup I get the following kind of error when interacting with A protobuf bindings:

java.lang.RuntimeException: Generated message class "A$Builder" missing method "getAMessageBuilder"

There are plenty of posts and questions about backwards compatibility between protobuf schemas, but what about library versions? Are there any guarantees between protobuf versions?

Upvotes: 2

Views: 1389

Answers (1)

Adam Cozzette
Adam Cozzette

Reputation: 1476

Protobuf for Java supports running older generated code against a newer runtime library and also mixing generated code from different compiler versions. However, this support only exists starting from version 3.0 (see the change log entry here). So in your case it would probably be best to upgrade to 3.0 (or higher) if possible and regenerate your code with the 3.0 protoc, but after that one-time step you will no longer need to worry about regenerating your code as you update the protobuf library version.

Upvotes: 3

Related Questions