Class CommitToOffsetManager
- java.lang.Object
-
- org.apache.camel.component.kafka.consumer.AbstractCommitManager
-
- org.apache.camel.component.kafka.consumer.CommitToOffsetManager
-
- All Implemented Interfaces:
CommitManager
public class CommitToOffsetManager extends AbstractCommitManager
-
-
Field Summary
-
Fields inherited from class org.apache.camel.component.kafka.consumer.AbstractCommitManager
configuration, kafkaConsumer, NON_PARTITION, printableTopic, START_OFFSET, threadId
-
-
Constructor Summary
Constructors Constructor Description CommitToOffsetManager(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 voidcommit()Commits everything that has been cachedvoidcommit(org.apache.kafka.common.TopicPartition partition)Commits the offsets of the given partitionvoidforceCommit(org.apache.kafka.common.TopicPartition partition, long partitionLastOffset)Forcefully commits the offset of the given partitionvoidrecordOffset(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
getManualCommit, getManualCommit, saveStateToOffsetRepository, serializeOffsetKey, serializeOffsetValue
-
-
-
-
Constructor Detail
-
CommitToOffsetManager
public CommitToOffsetManager(org.apache.kafka.clients.consumer.Consumer<?,?> consumer, KafkaConsumer kafkaConsumer, String threadId, String printableTopic)
-
-
Method Detail
-
commit
public void commit(org.apache.kafka.common.TopicPartition partition)
Description copied from interface:CommitManagerCommits the offsets of the given partition- Parameters:
partition- the partition to commit the offsets
-
forceCommit
public void forceCommit(org.apache.kafka.common.TopicPartition partition, long partitionLastOffset)Description copied from interface:CommitManagerForcefully commits the offset of the given partition- Specified by:
forceCommitin interfaceCommitManager- Overrides:
forceCommitin classAbstractCommitManager- Parameters:
partition- the partition to commit the offsetspartitionLastOffset- the last offset to commit
-
commit
public void commit()
Description copied from interface:CommitManagerCommits everything that has been cached
-
recordOffset
public void recordOffset(org.apache.kafka.common.TopicPartition partition, long partitionLastOffset)Description copied from interface:CommitManagerRecord the last processed offset for future commit- Parameters:
partition- the partition to commit the offsetspartitionLastOffset- the last offset to commit
-
-