|
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.AbstractOffsetManager
public abstract class AbstractOffsetManager
Base implementation for OffsetManager
. Subclasses may customize functionality as necessary.
Field Summary | |
---|---|
protected ConnectionFactory |
connectionFactory
|
protected java.lang.String |
consumerId
|
protected java.util.Map<Partition,java.lang.Long> |
initialOffsets
|
protected org.apache.commons.logging.Log |
log
|
protected long |
referenceTimestamp
|
Constructor Summary | |
---|---|
AbstractOffsetManager(ConnectionFactory connectionFactory)
|
|
AbstractOffsetManager(ConnectionFactory connectionFactory,
java.util.Map<Partition,java.lang.Long> initialOffsets)
|
Method Summary | |
---|---|
void |
deleteOffset(Partition partition)
Removes the offset for a given Partition . |
void |
destroy()
|
protected abstract java.lang.Long |
doGetOffset(Partition partition)
|
protected abstract void |
doRemoveOffset(Partition partition)
|
protected abstract void |
doUpdateOffset(Partition partition,
long offset)
|
java.lang.String |
getConsumerId()
|
long |
getOffset(Partition partition)
Retrieves the offset for a given Partition |
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 |
setReferenceTimestamp(long referenceTimestamp)
A timestamp to be used for resetting initial offsets |
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 |
Methods inherited from interface java.io.Closeable |
---|
close |
Methods inherited from interface java.io.Flushable |
---|
flush |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected java.lang.String consumerId
protected long referenceTimestamp
protected ConnectionFactory connectionFactory
protected java.util.Map<Partition,java.lang.Long> initialOffsets
Constructor Detail |
---|
public AbstractOffsetManager(ConnectionFactory connectionFactory)
public AbstractOffsetManager(ConnectionFactory connectionFactory, java.util.Map<Partition,java.lang.Long> initialOffsets)
Method Detail |
---|
public java.lang.String getConsumerId()
public void setConsumerId(java.lang.String consumerId)
consumerId
- the consumer IDpublic void setReferenceTimestamp(long referenceTimestamp)
referenceTimestamp
- the reset timestamp for initial offsetspublic void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public final 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 final 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 deleteOffset(Partition partition)
OffsetManager
Partition
. Useful
for components that need to clean up after themselves.
deleteOffset
in interface OffsetManager
partition
- for which to delete the JavaDocprotected abstract void doUpdateOffset(Partition partition, long offset)
protected abstract void doRemoveOffset(Partition partition)
protected abstract java.lang.Long doGetOffset(Partition partition)
|
Spring Integration Kafka Support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |