public interface KafkaRecordDeserializer<T> extends Serializable, ResultTypeQueryable<T>
Modifier and Type | Method and Description |
---|---|
void |
deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record,
Collector<T> collector)
Deserialize a consumer record into the given collector.
|
static <V> KafkaRecordDeserializer<V> |
valueOnly(Class<? extends org.apache.kafka.common.serialization.Deserializer<V>> valueDeserializerClass)
Wraps a Kafka
Deserializer to a KafkaRecordDeserializer . |
static <V,D extends org.apache.kafka.common.Configurable & org.apache.kafka.common.serialization.Deserializer<V>> |
valueOnly(Class<D> valueDeserializerClass,
Map<String,String> config)
Wraps a Kafka
Deserializer to a KafkaRecordDeserializer . |
getProducedType
void deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record, Collector<T> collector) throws Exception
record
- the ConsumerRecord
to deserialize.Exception
- if the deserialization failed.static <V> KafkaRecordDeserializer<V> valueOnly(Class<? extends org.apache.kafka.common.serialization.Deserializer<V>> valueDeserializerClass)
Deserializer
to a KafkaRecordDeserializer
.V
- the value type.valueDeserializerClass
- the deserializer class used to deserialize the value.KafkaRecordDeserializer
that deserialize the value with the given
deserializer.static <V,D extends org.apache.kafka.common.Configurable & org.apache.kafka.common.serialization.Deserializer<V>> KafkaRecordDeserializer<V> valueOnly(Class<D> valueDeserializerClass, Map<String,String> config)
Deserializer
to a KafkaRecordDeserializer
.V
- the value type.D
- the type of the deserializer.valueDeserializerClass
- the deserializer class used to deserialize the value.config
- the configuration of the value deserializer, only valid when the deserializer
is an implementation of Configurable
.KafkaRecordDeserializer
that deserialize the value with the given
deserializer.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.