Although not mandatory, Apache Dubbo supports using Protocol Buffers (proto3) for service definitions and serialization protocols.
Within the protocol buffer framework, we use .proto
files to define services and message body formats, and the protoc
compiler to compile .proto
files. You can install protoc
in the following ways.
On Linux or macOS, you can use a package manager to install protoc
.
Be sure to check the installed version of protoc
! This can be done as described below, since some package managers might install severely outdated versions of protoc
.
The Binary Installation method mentioned in the next section ensures that you install the correct version of protoc
.
Linux, using apt
or apt-get
, for example:
macOS, using Homebrew:
Follow these steps to install the latest version of the protoc
binary package:
Manually download the binary files for your OS from github.com/google/protobuf/releases
(protoc-<version>-<os>-<arch>.zip
), or use the following commands to download directly:
Unzip the file to the $HOME/.local
directory, or any directory of your choice. For example:
Modify the system PATH
to include the protoc
executable. For example:
If you want to compile from the source yourself, or if you want to install an older version of the binary package, please refer to Download Protocol Buffers