public abstract class AbstractConsumerSeekAware extends java.lang.Object implements ConsumerSeekAware
ConsumerSeekAware.ConsumerSeekCallback s for the listener. If the
listener subclasses this class, it can easily seek arbitrary topics/partitions without
having to keep track of the callbacks itself.ConsumerSeekAware.ConsumerSeekCallback| Constructor and Description |
|---|
AbstractConsumerSeekAware() |
| Modifier and Type | Method and Description |
|---|---|
protected ConsumerSeekAware.ConsumerSeekCallback |
getSeekCallbackFor(org.apache.kafka.common.TopicPartition topicPartition)
Return the callback for the specified topic/partition.
|
protected java.util.Map<org.apache.kafka.common.TopicPartition,ConsumerSeekAware.ConsumerSeekCallback> |
getSeekCallbacks()
The map of callbacks for all currently assigned partitions.
|
void |
onPartitionsAssigned(java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> assignments,
ConsumerSeekAware.ConsumerSeekCallback callback)
When using group management, called when partition assignments change.
|
void |
onPartitionsRevoked(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
When using group management, called when partition assignments are revoked.
|
void |
registerSeekCallback(ConsumerSeekAware.ConsumerSeekCallback callback)
Register the callback to use when seeking at some arbitrary time.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonIdleContainerpublic void registerSeekCallback(ConsumerSeekAware.ConsumerSeekCallback callback)
ConsumerSeekAwareConcurrentMessageListenerContainer or the same listener instance in multiple
containers listeners should store the callback in a ThreadLocal.registerSeekCallback in interface ConsumerSeekAwarecallback - the callback.public void onPartitionsAssigned(java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> assignments,
ConsumerSeekAware.ConsumerSeekCallback callback)
ConsumerSeekAwareonPartitionsAssigned in interface ConsumerSeekAwareassignments - the new assignments and their current offsets.callback - the callback to perform an initial seek after assignment.public void onPartitionsRevoked(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
ConsumerSeekAwareConsumerSeekAware.registerSeekCallback(ConsumerSeekCallback) on this thread.onPartitionsRevoked in interface ConsumerSeekAwarepartitions - the partitions that have been revoked.@Nullable protected ConsumerSeekAware.ConsumerSeekCallback getSeekCallbackFor(org.apache.kafka.common.TopicPartition topicPartition)
topicPartition - the topic/partition.protected java.util.Map<org.apache.kafka.common.TopicPartition,ConsumerSeekAware.ConsumerSeekCallback> getSeekCallbacks()