Class KafkaDelayedRetryTopic
java.lang.Object
io.smallrye.reactive.messaging.kafka.commit.ContextHolder
io.smallrye.reactive.messaging.kafka.fault.KafkaDelayedRetryTopic
- All Implemented Interfaces:
KafkaFailureHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.smallrye.reactive.messaging.kafka.fault.KafkaFailureHandler
KafkaFailureHandler.Strategy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class io.smallrye.reactive.messaging.kafka.commit.ContextHolder
context
-
Constructor Summary
ConstructorDescriptionKafkaDelayedRetryTopic
(String channel, io.vertx.mutiny.core.Vertx vertx, KafkaConnectorIncomingConfiguration configuration, List<String> retryTopics, int maxRetries, long retryTimeout, String deadQueueTopic, KafkaProducer producer, ReactiveKafkaConsumer consumer, BiConsumer<Throwable, Boolean> reportFailure) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getNextTopic
(List<String> topics, String deadQueueTopic, int maxRetries, int retryCount) static int
getRetryHeader
(org.apache.kafka.common.header.Headers headers) static String
getRetryTopic
(String topic, int delayMillis) <K,
V> io.smallrye.mutiny.Uni<Void> handle
(IncomingKafkaRecord<K, V> record, Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata) Handle message negative-acknowledgmentio.smallrye.mutiny.Multi<? extends IncomingKafkaRecord<?,
?>> void
Called on channel shutdownMethods inherited from class io.smallrye.reactive.messaging.kafka.commit.ContextHolder
capture, capture, getContext, getTimeoutInMillis, runOnContext, runOnContextAndAwait
-
Field Details
-
DELAYED_RETRY_TOPIC_STRATEGY
- See Also:
-
DELAYED_RETRY_COUNT
- See Also:
-
DELAYED_RETRY_ORIGINAL_TIMESTAMP
- See Also:
-
DELAYED_RETRY_FIRST_PROCESSING_TIMESTAMP
- See Also:
-
DELAYED_RETRY_EXCEPTION_CLASS_NAME
- See Also:
-
DELAYED_RETRY_CAUSE_CLASS_NAME
- See Also:
-
DELAYED_RETRY_REASON
- See Also:
-
DELAYED_RETRY_CAUSE
- See Also:
-
DELAYED_RETRY_TOPIC
- See Also:
-
DELAYED_RETRY_OFFSET
- See Also:
-
DELAYED_RETRY_PARTITION
- See Also:
-
-
Constructor Details
-
KafkaDelayedRetryTopic
public KafkaDelayedRetryTopic(String channel, io.vertx.mutiny.core.Vertx vertx, KafkaConnectorIncomingConfiguration configuration, List<String> retryTopics, int maxRetries, long retryTimeout, String deadQueueTopic, KafkaProducer producer, ReactiveKafkaConsumer consumer, BiConsumer<Throwable, Boolean> reportFailure)
-
-
Method Details
-
getRetryTopic
-
retryStream
-
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:KafkaFailureHandler
Handle message negative-acknowledgment- Specified by:
handle
in 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:KafkaFailureHandler
Called on channel shutdown- Specified by:
terminate
in interfaceKafkaFailureHandler
-
getNextTopic
-
getRetryHeader
public static int getRetryHeader(org.apache.kafka.common.header.Headers headers)
-