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 Summary
ConstructorDescriptionRetryingDeserializer
(org.apache.kafka.common.serialization.Deserializer<T> delegate, org.springframework.retry.RetryOperations retryOperations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
deserialize
(String topic, byte[] data) deserialize
(String topic, org.apache.kafka.common.header.Headers headers, byte[] data) deserialize
(String topic, org.apache.kafka.common.header.Headers headers, ByteBuffer data) void
setRecoveryCallback
(org.springframework.retry.RecoveryCallback<T> recoveryCallback) Set a recovery callback to execute when the retries are exhausted.
-
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
- Specified by:
configure
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
deserialize
- Specified by:
deserialize
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
deserialize
- Specified by:
deserialize
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
deserialize
- Specified by:
deserialize
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.kafka.common.serialization.Deserializer<T>
-