Class DeserializerWrapper<T>
- java.lang.Object
 - 
- io.smallrye.reactive.messaging.kafka.fault.DeserializerWrapper<T>
 
 
- 
- Type Parameters:
 T- the type of object created by the deserializer.
- All Implemented Interfaces:
 Closeable,AutoCloseable,org.apache.kafka.common.serialization.Deserializer<T>
public class DeserializerWrapper<T> extends Object implements org.apache.kafka.common.serialization.Deserializer<T>
Wraps a delegate deserializer to handle config and deserialization failures. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringDESERIALIZATION_FAILURE_CAUSEHeader name for deserialization failure cause if any.static StringDESERIALIZATION_FAILURE_DATAHeader name passing the data that was not able to be deserialized.static StringDESERIALIZATION_FAILURE_DESERIALIZERHeader name passing the class name of the underlying deserializer.static StringDESERIALIZATION_FAILURE_IS_KEYHeader name used when the deserialization failure happened on a key.static StringDESERIALIZATION_FAILURE_REASONHeader name for deserialization failure message.static StringDESERIALIZATION_FAILURE_TOPICHeader name for the topic of the incoming message when a deserialization failure happen. 
- 
Constructor Summary
Constructors Constructor Description DeserializerWrapper(String className, boolean key, DeserializationFailureHandler<T> failureHandler, KafkaSource<?,?> source) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconfigure(Map<String,?> configs, boolean isKey)Delegates to the underlying deserializer instance.Tdeserialize(String topic, byte[] data)Tdeserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data) 
 - 
 
- 
- 
Field Detail
- 
DESERIALIZATION_FAILURE_REASON
public static final String DESERIALIZATION_FAILURE_REASON
Header name for deserialization failure message.- See Also:
 - Constant Field Values
 
 
- 
DESERIALIZATION_FAILURE_CAUSE
public static final String DESERIALIZATION_FAILURE_CAUSE
Header name for deserialization failure cause if any.- See Also:
 - Constant Field Values
 
 
- 
DESERIALIZATION_FAILURE_IS_KEY
public static final String DESERIALIZATION_FAILURE_IS_KEY
Header name used when the deserialization failure happened on a key. The value is"true"in this case, absent otherwise.- See Also:
 - Constant Field Values
 
 
- 
DESERIALIZATION_FAILURE_TOPIC
public static final String DESERIALIZATION_FAILURE_TOPIC
Header name for the topic of the incoming message when a deserialization failure happen.- See Also:
 - Constant Field Values
 
 
- 
DESERIALIZATION_FAILURE_DATA
public static final String DESERIALIZATION_FAILURE_DATA
Header name passing the data that was not able to be deserialized.- See Also:
 - Constant Field Values
 
 
- 
DESERIALIZATION_FAILURE_DESERIALIZER
public static final String DESERIALIZATION_FAILURE_DESERIALIZER
Header name passing the class name of the underlying deserializer.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
DeserializerWrapper
public DeserializerWrapper(String className, boolean key, DeserializationFailureHandler<T> failureHandler, KafkaSource<?,?> source)
 
 - 
 
- 
Method Detail
- 
configure
public void configure(Map<String,?> configs, boolean isKey)
Delegates to the underlying deserializer instance.- Specified by:
 configurein interfaceorg.apache.kafka.common.serialization.Deserializer<T>- Parameters:
 configs- the configurationisKey- the key
 
- 
deserialize
public T deserialize(String topic, byte[] data)
- Specified by:
 deserializein interfaceorg.apache.kafka.common.serialization.Deserializer<T>
 
- 
deserialize
public T deserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data)
- Specified by:
 deserializein interfaceorg.apache.kafka.common.serialization.Deserializer<T>
 
- 
close
public void close()
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Specified by:
 closein interfaceorg.apache.kafka.common.serialization.Deserializer<T>
 
 - 
 
 -