org.springframework.integration.kafka.listener
Class MetadataStoreOffsetManager
java.lang.Object
org.springframework.integration.kafka.listener.AbstractOffsetManager
org.springframework.integration.kafka.listener.MetadataStoreOffsetManager
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, org.springframework.beans.factory.DisposableBean, OffsetManager
public class MetadataStoreOffsetManager
- extends AbstractOffsetManager
An OffsetManager
that persists offsets into a MetadataStore
.
- Author:
- Marius Bogoevici
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MetadataStoreOffsetManager
public MetadataStoreOffsetManager(ConnectionFactory connectionFactory)
MetadataStoreOffsetManager
public MetadataStoreOffsetManager(ConnectionFactory connectionFactory,
java.util.Map<Partition,java.lang.Long> initialOffsets)
setMetadataStore
public void setMetadataStore(org.springframework.integration.metadata.MetadataStore metadataStore)
- The backing
MetadataStore
for storing offsets.
- Parameters:
metadataStore
- a fully configured MetadataStore
instance
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
doUpdateOffset
protected void doUpdateOffset(Partition partition,
long offset)
- Specified by:
doUpdateOffset
in class AbstractOffsetManager
doRemoveOffset
protected void doRemoveOffset(Partition partition)
- Specified by:
doRemoveOffset
in class AbstractOffsetManager
doGetOffset
protected java.lang.Long doGetOffset(Partition partition)
- Specified by:
doGetOffset
in class AbstractOffsetManager
generateKey
public java.lang.String generateKey(Partition partition)