public class KafkaNativeOffsetManager extends AbstractOffsetManager implements org.springframework.beans.factory.InitializingBean
OffsetManager that uses kafka native 'topic' offset storage.connectionFactory, consumerId, highestUpdatedOffsets, initialOffsets, log, referenceTimestamp| Constructor and Description |
|---|
KafkaNativeOffsetManager(ConnectionFactory connectionFactory,
ZookeeperConnect zookeeperConnect) |
KafkaNativeOffsetManager(ConnectionFactory connectionFactory,
ZookeeperConnect zookeeperConnect,
java.util.Map<Partition,java.lang.Long> initialOffsets) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
close() |
protected java.lang.Long |
doGetOffset(Partition partition) |
protected void |
doRemoveOffset(Partition partition) |
protected void |
doUpdateOffset(Partition partition,
long offset) |
void |
flush() |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) |
deleteOffset, destroy, getConsumerId, getOffset, resetOffsets, setConsumerId, setReferenceTimestamp, updateOffsetpublic KafkaNativeOffsetManager(ConnectionFactory connectionFactory, ZookeeperConnect zookeeperConnect)
connectionFactory - a Kafka connection factoryzookeeperConnect - the zookeeper connection informationpublic KafkaNativeOffsetManager(ConnectionFactory connectionFactory, ZookeeperConnect zookeeperConnect, java.util.Map<Partition,java.lang.Long> initialOffsets)
connectionFactory - a Kafka connection factoryzookeeperConnect - zookeeper connection for retrievinginitialOffsets - a map of partitions to initial offsetspublic void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionprotected java.lang.Long doGetOffset(Partition partition)
doGetOffset in class AbstractOffsetManagerprotected void doUpdateOffset(Partition partition, long offset)
doUpdateOffset in class AbstractOffsetManagerprotected void doRemoveOffset(Partition partition)
doRemoveOffset in class AbstractOffsetManagerpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOException