#json-schema #protobuf #kafka #avro

schema-registry-client

Serialize/deserialize data to/from Kafka using the Confluent Schema Registry

7 unstable releases (3 breaking)

Uses new Rust 2024

0.4.1 Aug 23, 2025
0.4.0 Jul 4, 2025
0.3.1 May 5, 2025
0.2.1 Apr 17, 2025
0.1.0 Apr 16, 2025

#1094 in Encoding

Download history 11/week @ 2025-09-01 2/week @ 2025-09-08 2/week @ 2025-09-15 20/week @ 2025-09-22 144/week @ 2025-09-29 383/week @ 2025-10-06 474/week @ 2025-10-13 482/week @ 2025-10-20 653/week @ 2025-10-27 651/week @ 2025-11-03 670/week @ 2025-11-10 612/week @ 2025-11-17 538/week @ 2025-11-24 1459/week @ 2025-12-01 1245/week @ 2025-12-08 363/week @ 2025-12-15

3,645 downloads per month

Apache-2.0

425KB
11K SLoC

rust-schema-registry-client

crates.io docs.rs Build Status license

A fully asynchronous Rust client library for interacting with the Confluent Schema Registry.

The library

rust-schema-registry-client provides a Schema Registry client, along with serdes (serializers/deserializers) for Avro, Protobuf, and JSON Schema.

Features

  • 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 rust-rdkafka but does not depend on it.

Serdes

Installation

Add this to your Cargo.toml:

[dependencies]
schema-registry-client = { version = "0.4.1" }

The following features are available:

  • rules-cel - enables data quality rules using CEL
  • rules-encryption-awskms - enables CSFLE rules using AWS KMS
  • rules-encryption-azurekms - enables CSFLE rules using Azure Key Vault
  • rules-encryption-gcpkms - enables CSFLE rules using Google Cloud KMS
  • rules-encryption-hcvault - enables CSFLE rules using HashiCorp Vault
  • rules-encryption-localkms - enables CSFLE rules using a local KMS (for testing)
  • rules-jsonata - enables schema migration rules using JSONata

For example, to use CSFLE with the AWS KMS, add this to your Cargo.toml:


[dependencies]
schema-registry-client = { version = "0.4.0", features = ["rules-encryption-awskms"] }

Examples

You can find examples in the examples folder. To run them:

cargo run --example <example_name> -- <example_args>

Further information can be found in this blog.

Dependencies

~23–49MB
~801K SLoC