[][src]Crate schema_registry_converter

Rust encoder and decoder in order to work with the Confluent schema registry.

This crate contains ways to handle encoding and decoding of messages making use of the confluent schema-registry. This happens in a way that is compatible to the confluent java serde. As a result it becomes easy to work with the same data in both the jvm and rust.

Both the Decoder and the Encoder have a cache to allow re-use of the Schema objects used for the avro transitions.

For Encoding data it's possible to supply a schema else the latest available schema will be used. For Decoding it works the same as the Java part, using the id encoded in the bytes, the correct schema will be fetched and used to decode the message to a avro_rs::types::Value.

Resulting errors are SRCError, besides the error they also contain a .cached which tells whether the error is cached or not. Another property added to the error is retriable, in some cases, like when the network fails it might be worth to retry the same function. The library itself doesn't automatically does retries.

Modules

schema_registry

This module contains the code specific for the schema registry.

Structs

Decoder

A decoder used to transform bytes to a Value object

Encoder

An encoder used to transform a Value object to bytes