|
Spring Integration Kafka Support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.kafka.listener.MetadataStoreOffsetManager
public class MetadataStoreOffsetManager
An OffsetManager
that persists offsets into a MetadataStore
.
Constructor Summary | |
---|---|
MetadataStoreOffsetManager(ConnectionFactory connectionFactory)
|
|
MetadataStoreOffsetManager(ConnectionFactory connectionFactory,
java.util.Map<Partition,java.lang.Long> initialOffsets)
|
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
java.lang.String |
getConsumerId()
|
org.springframework.integration.metadata.MetadataStore |
getMetadataStore()
|
long |
getOffset(Partition partition)
Retrieves the offset for a given Partition |
long |
getReferenceTimestamp()
|
void |
resetOffsets(java.util.Collection<Partition> partitionsToReset)
Resets offsets for the given Partition s. |
void |
setConsumerId(java.lang.String consumerId)
The identifier of a consumer of Kafka messages. |
void |
setMetadataStore(org.springframework.integration.metadata.MetadataStore metadataStore)
The backing MetadataStore for storing offsets. |
void |
setReferenceTimestamp(long referenceTimestamp)
A timestamp to be used for resetting initial offsets, if they are not available in the MetadataStore |
void |
updateOffset(Partition partition,
long offset)
Updates the offset for a given Partition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetadataStoreOffsetManager(ConnectionFactory connectionFactory)
public MetadataStoreOffsetManager(ConnectionFactory connectionFactory, java.util.Map<Partition,java.lang.Long> initialOffsets)
Method Detail |
---|
public java.lang.String getConsumerId()
public void setConsumerId(java.lang.String consumerId)
MetadataStore
.
consumerId
- the consumer IDpublic org.springframework.integration.metadata.MetadataStore getMetadataStore()
public void setMetadataStore(org.springframework.integration.metadata.MetadataStore metadataStore)
MetadataStore
for storing offsets.
metadataStore
- a fully configured MetadataStore
instancepublic long getReferenceTimestamp()
public void setReferenceTimestamp(long referenceTimestamp)
MetadataStore
referenceTimestamp
- the reset timestamp for initial offsetspublic void updateOffset(Partition partition, long offset)
OffsetManager
Partition
updateOffset
in interface OffsetManager
partition
- the partition whose offset is to be updatedoffset
- the new offset valueOffsetManager.updateOffset(Partition, long)
public long getOffset(Partition partition)
OffsetManager
Partition
getOffset
in interface OffsetManager
partition
- the partition to be
OffsetManager.getOffset(Partition)
public void resetOffsets(java.util.Collection<Partition> partitionsToReset)
OffsetManager
Partition
s. To be invoked when the values stored are invalid,
so a client cannot resume from that position. Implementations must decide on the best strategy to follow.
resetOffsets
in interface OffsetManager
partitionsToReset
- to resetpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
|
Spring Integration Kafka Support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |