org.springframework.integration.kafka.listener
Interface OffsetManager

All Superinterfaces:
java.io.Closeable, java.io.Flushable
All Known Implementing Classes:
AbstractOffsetManager, KafkaTopicOffsetManager, MetadataStoreOffsetManager

public interface OffsetManager
extends java.io.Closeable, java.io.Flushable

Stores and retrieves offsets for a Kafka consumer


Method Summary
 void deleteOffset(Partition partition)
          Removes the offset for a given Partition.
 long getOffset(Partition partition)
          Retrieves the offset for a given Partition
 void resetOffsets(java.util.Collection<Partition> partition)
          Resets offsets for the given Partitions.
 void updateOffset(Partition partition, long offset)
          Updates the offset for a given Partition
 
Methods inherited from interface java.io.Closeable
close
 
Methods inherited from interface java.io.Flushable
flush
 

Method Detail

updateOffset

void updateOffset(Partition partition,
                  long offset)
Updates the offset for a given Partition

Parameters:
partition - the partition whose offset is to be updated
offset - the new offset value

getOffset

long getOffset(Partition partition)
Retrieves the offset for a given Partition

Parameters:
partition - the partition to be
Returns:
the offset value

deleteOffset

void deleteOffset(Partition partition)
Removes the offset for a given Partition. Useful for components that need to clean up after themselves.

Parameters:
partition - for which to delete the JavaDoc

resetOffsets

void resetOffsets(java.util.Collection<Partition> partition)
Resets offsets for the given Partitions. 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.

Parameters:
partition - to reset