tree: 72d6495c3e755fc64959289bc290ec18e00817dd [path history] [tgz]
  1. LICENSE.protobuf.txt
  2. protobuf.patch

Protocol Buffer code generation

Pulsar uses protocol buffer messages for the client/broker wire protocol.

The protocol definition is located at pulsar-common/src/main/proto/PulsarApi.proto and the pre-generated Java code is at pulsar-common/src/main/java/com/yahoo/pulsar/common/api/proto/

When making a change to the PulsarApi.proto definition, we have regenerate the and include that in the same commit.

We are currently using a modified version of the Google Protocol Buffer code generator, to generate code that can serialize/deserialize messages with no memory allocations (caching already instantiated objects) and also to be able to directly use Netty pooled ByteBuf with direct memory.

To re-generate the code you need to apply a patch to the protobuf generator. Patch is found at protobuf.patch.

git clone
cd protobuf
git checkout v2.4.1

# Apply patch
patch -p1 < ../pulsar-path/protobuf/protobuf.patch

# Compile protobuf

# This would leave the binary in src/protoc

# Re-generate PulsarApi
cd pulsar-path/pulsar-common
PROTOC=~/protobuf/src/protoc ./