Class RetryingDeserializer<T>

  • Type Parameters:
    T - Type to be deserialized into.
    All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.kafka.common.serialization.Deserializer<T>

    public class RetryingDeserializer<T>
    extends java.lang.Object
    implements org.apache.kafka.common.serialization.Deserializer<T>
    A deserialzer configured with a delegate and a RetryOperations to retry deserialization in case of transient errors.
    Since:
    2.3
    Author:
    Gary Russell
    • Constructor Summary

      Constructors 
      Constructor Description
      RetryingDeserializer​(org.apache.kafka.common.serialization.Deserializer<T> delegate, org.springframework.retry.RetryOperations retryOperations)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void configure​(java.util.Map<java.lang.String,​?> configs, boolean isKey)  
      T deserialize​(java.lang.String topic, byte[] data)  
      T deserialize​(java.lang.String topic, org.apache.kafka.common.header.Headers headers, byte[] data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RetryingDeserializer

        public RetryingDeserializer​(org.apache.kafka.common.serialization.Deserializer<T> delegate,
                                    org.springframework.retry.RetryOperations retryOperations)
    • Method Detail

      • configure

        public void configure​(java.util.Map<java.lang.String,​?> configs,
                              boolean isKey)
        Specified by:
        configure in interface org.apache.kafka.common.serialization.Deserializer<T>
      • deserialize

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

        public T deserialize​(java.lang.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 java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface org.apache.kafka.common.serialization.Deserializer<T>