Class KafkaDeadLetterQueue
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.fault.KafkaDeadLetterQueue
-
- All Implemented Interfaces:
KafkaFailureHandler
public class KafkaDeadLetterQueue extends Object implements KafkaFailureHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKafkaDeadLetterQueue.Factory-
Nested classes/interfaces inherited from interface io.smallrye.reactive.messaging.kafka.fault.KafkaFailureHandler
KafkaFailureHandler.Strategy
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEAD_LETTER_CAUSEstatic StringDEAD_LETTER_CAUSE_CLASS_NAMEstatic StringDEAD_LETTER_EXCEPTION_CLASS_NAMEstatic StringDEAD_LETTER_OFFSETstatic StringDEAD_LETTER_PARTITIONstatic StringDEAD_LETTER_REASONstatic StringDEAD_LETTER_TOPIC
-
Constructor Summary
Constructors Constructor Description KafkaDeadLetterQueue(String channel, String topic, KafkaProducer producer, BiConsumer<Throwable,Boolean> reportFailure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
io.smallrye.mutiny.Uni<Void>handle(IncomingKafkaRecord<K,V> record, Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)Handle message negative-acknowledgmentvoidterminate()Called on channel shutdown
-
-
-
Field Detail
-
DEAD_LETTER_EXCEPTION_CLASS_NAME
public static final String DEAD_LETTER_EXCEPTION_CLASS_NAME
- See Also:
- Constant Field Values
-
DEAD_LETTER_CAUSE_CLASS_NAME
public static final String DEAD_LETTER_CAUSE_CLASS_NAME
- See Also:
- Constant Field Values
-
DEAD_LETTER_REASON
public static final String DEAD_LETTER_REASON
- See Also:
- Constant Field Values
-
DEAD_LETTER_CAUSE
public static final String DEAD_LETTER_CAUSE
- See Also:
- Constant Field Values
-
DEAD_LETTER_TOPIC
public static final String DEAD_LETTER_TOPIC
- See Also:
- Constant Field Values
-
DEAD_LETTER_OFFSET
public static final String DEAD_LETTER_OFFSET
- See Also:
- Constant Field Values
-
DEAD_LETTER_PARTITION
public static final String DEAD_LETTER_PARTITION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KafkaDeadLetterQueue
public KafkaDeadLetterQueue(String channel, String topic, KafkaProducer producer, BiConsumer<Throwable,Boolean> reportFailure)
-
-
Method Detail
-
handle
public <K,V> io.smallrye.mutiny.Uni<Void> handle(IncomingKafkaRecord<K,V> record, Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)
Description copied from interface:KafkaFailureHandlerHandle message negative-acknowledgment- Specified by:
handlein interfaceKafkaFailureHandler- Type Parameters:
K- type of record keyV- type of record value- Parameters:
record- incoming Kafka recordreason- nack reasonmetadata- associated metadata with negative-acknowledgment- Returns:
- a completion stage completed when the message is negative-acknowledgement has completed.
-
terminate
public void terminate()
Description copied from interface:KafkaFailureHandlerCalled on channel shutdown- Specified by:
terminatein interfaceKafkaFailureHandler
-
-