Class RetryingDeserializer<T>

java.lang.Object
org.springframework.kafka.support.serializer.RetryingDeserializer<T>
Type Parameters:
T - Type to be deserialized into.
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.common.serialization.Deserializer<T>

public class RetryingDeserializer<T> extends Object implements org.apache.kafka.common.serialization.Deserializer<T>
A deserializer configured with a delegate and a RetryOperations to retry deserialization in case of transient errors.
Since:
2.3
Author:
Gary Russell, Wang Zhiyang, Soby Chacko
  • Constructor Details

    • RetryingDeserializer

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

    • setRecoveryCallback

      public void setRecoveryCallback(@Nullable org.springframework.retry.RecoveryCallback<T> recoveryCallback)
      Set a recovery callback to execute when the retries are exhausted.
      Parameters:
      recoveryCallback - RecoveryCallback to execute
      Since:
      3.1.2
    • configure

      public void configure(Map<String,?> configs, boolean isKey)
      Specified by:
      configure in interface org.apache.kafka.common.serialization.Deserializer<T>
    • 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>
    • deserialize

      public T deserialize(String topic, org.apache.kafka.common.header.Headers headers, ByteBuffer 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>