Spring Integration Kafka Support

org.springframework.integration.kafka.listener
Interface OffsetManager

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

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

Stores and retrieves offsets for a Kafka consumer

Author:
Marius Bogoevici

Method Summary
 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

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

Spring Integration Kafka Support