Expand description
Rust encoders and decoders 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 apache_avro::types::Value
.
Resulting errors are crate::error::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§
- async_
impl - async supported implementations. Requires
futures
feature. - avro_
common - Common structures and functions of the crate
- blocking
- blocking implementations. Requires
blocking
feature. - error
- implementation for
SRCError
- proto_
raw_ common - proto_
resolver - schema_
registry_ common - Contains structs, enums’ and functions common to async and blocking implementation of schema registry. So stuff dealing with the responses from schema registry, determining the subject, etc.