Class KafkaBlockingRetryDeadLetterRecoverer
java.lang.Object
com.broadleafcommerce.common.messaging.retry.kafka.KafkaBlockingRetryDeadLetterRecoverer
- All Implemented Interfaces:
BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,,?>, Exception> org.springframework.kafka.listener.ConsumerRecordRecoverer
public class KafkaBlockingRetryDeadLetterRecoverer
extends Object
implements org.springframework.kafka.listener.ConsumerRecordRecoverer
Recoverer for blocking retry that will forward the message to a dead letter queue.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionKafkaBlockingRetryDeadLetterRecoverer(com.broadleafcommerce.common.extension.compatibility.support.messaging.TimeoutAwareStreamBridge streamBridge, String dlq, String consumerBinding, String group, org.springframework.core.convert.converter.Converter<String, String> traceTruncator) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ObjectconvertHeader(String key, byte[] header) Convert the byte array version of a header fromConsumerRecordto a stringprotected ExceptionRetrieve the relevant root exception for reporting as a header on the messageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiConsumer
andThen
-
Constructor Details
-
KafkaBlockingRetryDeadLetterRecoverer
-
-
Method Details
-
accept
public void accept(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> consumerRecord, Exception e) - Specified by:
acceptin interfaceBiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>, Exception>
-
convertHeader
Convert the byte array version of a header fromConsumerRecordto a string- Parameters:
key- The header keyheader- The byte array version- Returns:
- The converted String value
-
getRoot
Retrieve the relevant root exception for reporting as a header on the message- Parameters:
e- The exception- Returns:
- The relevant root exception
-