A C++ client library for interacting with Confluent Schema Registry.
libschemaregistry provides a Schema Registry client, along with serdes (serializers/deserializers) for
Avro, Protobuf, and JSON Schema.
- Support for Avro, Protobuf, and JSON Schema formats
- Data quality rules using Google Common Expression Language (CEL) expressions
- Schema migration rules using JSONata expressions
- Client-side field-level encryption (CSFLE) rules using AWS KMS, Azure Key Vault, Google Cloud KMS, or HashiCorp Vault
This library can be used with librdkafka but does not depend on it.
- [
AvroSerializer] and [AvroDeserializer] - serdes that useavro-cpp - [
ProtobufSerializer] and [ProtobufDeserializer] - serdes that useprotobuf - [
JsonSerializer] and [JsonDeserializer] - serdes that usejsoncons
- C++17 compatible compiler (C++20 is required for data quality rules on Windows)
- Java 11 (for the Antlr parser)
- CMake 3.22+
- Ninja
- vcpkg
To build, first install vcpkg. Next, run CMake as follows:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
cmake --build build -j
cmake --install build --prefix /usr/localfind_package(schemaregistry CONFIG REQUIRED)
target_link_libraries(myapp PRIVATE schemaregistry::schemaregistry)This project installs a CMake package called schemaregistry. The installed target is exported under the schemaregistry:: namespace. In the build tree, an alias with the same namespace is provided for consistency.
You can find examples in the example folder.