Class AsyncCommitManager
- java.lang.Object
-
- org.apache.camel.component.kafka.consumer.AbstractCommitManager
-
- org.apache.camel.component.kafka.consumer.AsyncCommitManager
-
- All Implemented Interfaces:
CommitManager
public class AsyncCommitManager extends AbstractCommitManager
-
-
Field Summary
-
Fields inherited from class org.apache.camel.component.kafka.consumer.AbstractCommitManager
configuration, kafkaConsumer, printableTopic, START_OFFSET, threadId
-
-
Constructor Summary
Constructors Constructor Description AsyncCommitManager(org.apache.kafka.clients.consumer.Consumer<?,?> consumer, KafkaConsumer kafkaConsumer, String threadId, String printableTopic)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit()
Commits everything that has been cachedvoid
commit(org.apache.kafka.common.TopicPartition partition)
Commits the offsets of the given partitionKafkaManualCommit
getManualCommit(org.apache.camel.Exchange exchange, org.apache.kafka.common.TopicPartition partition, org.apache.kafka.clients.consumer.ConsumerRecord<Object,Object> record)
void
recordOffset(org.apache.kafka.common.TopicPartition partition, long partitionLastOffset)
Record the last processed offset for future commit-
Methods inherited from class org.apache.camel.component.kafka.consumer.AbstractCommitManager
forceCommit, getManualCommit, saveStateToOffsetRepository, serializeOffsetKey, serializeOffsetValue
-
-
-
-
Constructor Detail
-
AsyncCommitManager
public AsyncCommitManager(org.apache.kafka.clients.consumer.Consumer<?,?> consumer, KafkaConsumer kafkaConsumer, String threadId, String printableTopic)
-
-
Method Detail
-
commit
public void commit()
Description copied from interface:CommitManager
Commits everything that has been cached
-
commit
public void commit(org.apache.kafka.common.TopicPartition partition)
Description copied from interface:CommitManager
Commits the offsets of the given partition- Parameters:
partition
- the partition to commit the offsets
-
getManualCommit
public KafkaManualCommit getManualCommit(org.apache.camel.Exchange exchange, org.apache.kafka.common.TopicPartition partition, org.apache.kafka.clients.consumer.ConsumerRecord<Object,Object> record)
- Specified by:
getManualCommit
in interfaceCommitManager
- Overrides:
getManualCommit
in classAbstractCommitManager
-
recordOffset
public void recordOffset(org.apache.kafka.common.TopicPartition partition, long partitionLastOffset)
Description copied from interface:CommitManager
Record the last processed offset for future commit- Parameters:
partition
- the partition to commit the offsetspartitionLastOffset
- the last offset to commit
-
-