| Modifier and Type | Class and Description |
|---|---|
class |
CatchAllExceptionConsumerRecordHandler<K,V>
A wrapper over a
ConsumerRecordHandler to catch and swallow all the exceptions throw from the
wrapped ConsumerRecordHandler when it failed to handle a consumed record. |
class |
RetriableConsumerRecordHandler<K,V>
A wrapper over a
ConsumerRecordHandler to let the wrapped ConsumerRecordHandler try to handle a
record in a limited times in case the handling process failed. |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> LcKafkaConsumerBuilder<K,V> |
LcKafkaConsumerBuilder.newBuilder(Map<String,Object> kafkaConfigs,
ConsumerRecordHandler<K,V> consumerRecordHandler)
Create a
LcKafkaConsumerBuilder used to build LcKafkaConsumer. |
static <K,V> LcKafkaConsumerBuilder<K,V> |
LcKafkaConsumerBuilder.newBuilder(Map<String,Object> kafkaConfigs,
ConsumerRecordHandler<K,V> consumerRecordHandler,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> valueDeserializer)
Create a
LcKafkaConsumerBuilder used to build LcKafkaConsumer. |
| Constructor and Description |
|---|
CatchAllExceptionConsumerRecordHandler(ConsumerRecordHandler<K,V> wrappedHandler)
Constructor for
CatchAllExceptionConsumerRecordHandler to just log the failed record when
the wrapped handler failed on calling handleRecord(ConsumerRecord). |
CatchAllExceptionConsumerRecordHandler(ConsumerRecordHandler<K,V> wrappedHandler,
BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>,Throwable> errorConsumer)
Constructor for
CatchAllExceptionConsumerRecordHandler to use a BiConsumer to handle the
failed record when the wrapped handler failed on calling handleRecord(ConsumerRecord). |
RetriableConsumerRecordHandler(ConsumerRecordHandler<K,V> wrappedHandler,
int maxRetryTimes)
Constructor for
RetriableConsumerRecordHandler with max retry times limit. |
RetriableConsumerRecordHandler(ConsumerRecordHandler<K,V> wrappedHandler,
int maxRetryTimes,
Duration retryInterval)
Constructor for
RetriableConsumerRecordHandler with max retry times limit and retry interval. |
Copyright © 2020 LeanCloud. All rights reserved.