Chapter 2. Compiling Protobuf Schema


Data Grid uses the ProtoStream API to store data as Protobuf-encoded entries.

Protobuf is a language-neutral format that allows clients to create and retrieve entries in remote caches using both Hot Rod and REST endpoints.

Compile Protobuf schema, .proto files, into C++ header and source files to describe your data to Data Grid.

Prerequisites

  • Install the Protobuf library and protobuf-devel package.

    # yum install protobuf
    # yum install protobuf-devel
    Copy to Clipboard Toggle word wrap

Procedure

  1. Set the LD_LIBRARY_PATH environment variable, if it is not already set.

    # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lib64
    Copy to Clipboard Toggle word wrap
  2. Compile Protobuf schema for the Hot Rod C++ client as required.

    # /bin/protoc --cpp_out dllexport_decl=HR_PROTO_EXPORT:/path/to/output/ $FILE
    Copy to Clipboard Toggle word wrap

    HR_PROTO_EXPORT is a macro that the Hot Rod C++ client expands when it compiles the Protobuf schema.

  3. Register your Protobuf schema with Data Grid if you plan to use queries.

Compile Protobuf schema, .proto files, into C++ header and source files to describe your data to Data Grid.

Procedure

  1. Open a command prompt to the installation directory for the Hot Rod C++ client.
  2. Compile Protobuf schema for the Hot Rod C++ client as required.

    bin\protoc --cpp_out dllexport_decl=HR_PROTO_EXPORT:path\to\output\ $FILE
    Copy to Clipboard Toggle word wrap

    HR_PROTO_EXPORT is a macro that the Hot Rod C++ client expands when it compiles the Protobuf schema.

  3. Register your Protobuf schema with Data Grid if you plan to use queries.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat