pub enum KafkaValueFormat {
Json,
RawString,
Bytes,
ConfluentAvro {
schema_registry: SchemaRegistryConfig,
},
ConfluentProtobuf {
schema_registry: SchemaRegistryConfig,
},
ConfluentJsonSchema {
schema_registry: SchemaRegistryConfig,
validate: bool,
},
}Expand description
How a Kafka message value (or key) is encoded on the wire.
Variants§
Json
Parse value bytes as a JSON document.
RawString
Treat value bytes as a UTF-8 string. Invalid UTF-8 fails per OnDecodeError.
Bytes
Pass value bytes through as a base64-encoded string inside the JSON record. On the sink side, expects a base64 string in the source record.
ConfluentAvro
schema-registry only.Confluent-wire-format Avro: magic byte + schema_id + Avro binary.
Fields
schema_registry: SchemaRegistryConfigConfluentProtobuf
schema-registry only.Confluent-wire-format Protobuf: magic byte + schema_id + protobuf binary.
Fields
schema_registry: SchemaRegistryConfigConfluentJsonSchema
schema-registry only.Confluent-wire-format JSON Schema: magic byte + schema_id + JSON payload.
When validate is true, decoded JSON is validated against the registered schema.
Implementations§
Source§impl KafkaValueFormat
impl KafkaValueFormat
Sourcepub fn is_schema_registry(&self) -> bool
pub fn is_schema_registry(&self) -> bool
True for Confluent Schema Registry wire formats (ConfluentAvro,
ConfluentProtobuf, ConfluentJsonSchema), which require a schema to
encode on the sink side. Always false when the schema-registry
feature is disabled (those variants don’t exist).
Trait Implementations§
Source§impl Clone for KafkaValueFormat
impl Clone for KafkaValueFormat
Source§fn clone(&self) -> KafkaValueFormat
fn clone(&self) -> KafkaValueFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KafkaValueFormat
impl Debug for KafkaValueFormat
Source§impl Default for KafkaValueFormat
impl Default for KafkaValueFormat
Source§fn default() -> KafkaValueFormat
fn default() -> KafkaValueFormat
Source§impl<'de> Deserialize<'de> for KafkaValueFormat
impl<'de> Deserialize<'de> for KafkaValueFormat
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KafkaValueFormat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KafkaValueFormat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for KafkaValueFormat
impl JsonSchema for KafkaValueFormat
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more