Class 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.
    • Method Detail

      • configure

        public void configure​(Map<String,​?> configs,
                              boolean isKey)
        Delegates to the underlying deserializer instance.
        Specified by:
        configure in interface org.apache.kafka.common.serialization.Deserializer<T>
        Parameters:
        configs - the configuration
        isKey - the key
      • deserialize

        public T deserialize​(String topic,
                             byte[] data)
        Specified by:
        deserialize in interface org.apache.kafka.common.serialization.Deserializer<T>
      • deserialize

        public T deserialize​(String topic,
                             org.apache.kafka.common.header.Headers headers,
                             byte[] data)
        Specified by:
        deserialize in interface org.apache.kafka.common.serialization.Deserializer<T>
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.apache.kafka.common.serialization.Deserializer<T>