Interface Consumer<K,V>
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
KafkaConsumer
,MockConsumer
public interface Consumer<K,V> extends java.io.Closeable
- See Also:
KafkaConsumer
,MockConsumer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
assign(java.util.Collection<TopicPartition> partitions)
void
assign(java.util.List<TopicPartition> partitions)
java.util.Set<TopicPartition>
assignment()
java.util.Map<TopicPartition,java.lang.Long>
beginningOffsets(java.util.Collection<TopicPartition> partitions)
java.util.Map<TopicPartition,java.lang.Long>
beginningOffsets(java.util.Collection<TopicPartition> partitions, java.time.Duration timeout)
void
close()
void
close(long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.void
close(java.time.Duration timeout)
void
commitAsync()
void
commitAsync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback callback)
void
commitAsync(OffsetCommitCallback callback)
void
commitSync()
void
commitSync(java.time.Duration timeout)
void
commitSync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets)
void
commitSync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, java.time.Duration timeout)
java.util.Map<TopicPartition,OffsetAndMetadata>
committed(java.util.Set<TopicPartition> partitions)
java.util.Map<TopicPartition,OffsetAndMetadata>
committed(java.util.Set<TopicPartition> partitions, java.time.Duration timeout)
OffsetAndMetadata
committed(TopicPartition partition)
Deprecated.OffsetAndMetadata
committed(TopicPartition partition, java.time.Duration timeout)
Deprecated.java.util.Map<TopicPartition,java.lang.Long>
endOffsets(java.util.Collection<TopicPartition> partitions)
java.util.Map<TopicPartition,java.lang.Long>
endOffsets(java.util.Collection<TopicPartition> partitions, java.time.Duration timeout)
void
enforceRebalance()
ConsumerGroupMetadata
groupMetadata()
java.util.Map<java.lang.String,java.util.List<PartitionInfo>>
listTopics()
java.util.Map<java.lang.String,java.util.List<PartitionInfo>>
listTopics(java.lang.String stream)
java.util.Map<java.lang.String,java.util.List<PartitionInfo>>
listTopics(java.lang.String stream, java.time.Duration timeout)
java.util.Map<java.lang.String,java.util.List<PartitionInfo>>
listTopics(java.time.Duration timeout)
java.util.Map<java.lang.String,java.util.List<PartitionInfo>>
listTopics(java.util.regex.Pattern pattern)
java.util.Map<MetricName,? extends Metric>
metrics()
java.util.Map<TopicPartition,OffsetAndTimestamp>
offsetsForTimes(java.util.Map<TopicPartition,java.lang.Long> timestampsToSearch)
java.util.Map<TopicPartition,OffsetAndTimestamp>
offsetsForTimes(java.util.Map<TopicPartition,java.lang.Long> timestampsToSearch, java.time.Duration timeout)
java.util.List<PartitionInfo>
partitionsFor(java.lang.String topic)
java.util.List<PartitionInfo>
partitionsFor(java.lang.String topic, java.time.Duration timeout)
void
pause(java.util.Collection<TopicPartition> partitions)
void
pause(TopicPartition... partitions)
Deprecated.java.util.Set<TopicPartition>
paused()
ConsumerRecords<K,V>
poll(long timeout)
Deprecated.ConsumerRecords<K,V>
poll(java.time.Duration timeout)
long
position(TopicPartition partition)
long
position(TopicPartition partition, java.time.Duration timeout)
void
resume(java.util.Collection<TopicPartition> partitions)
void
resume(TopicPartition... partitions)
Deprecated.void
seek(TopicPartition partition, long offset)
void
seek(TopicPartition partition, OffsetAndMetadata offsetAndMetadata)
void
seekToBeginning(java.util.Collection<TopicPartition> partitions)
void
seekToBeginning(TopicPartition... partitions)
Deprecated.void
seekToEnd(java.util.Collection<TopicPartition> partitions)
void
seekToEnd(TopicPartition... partitions)
Deprecated.void
subscribe(java.util.Collection<java.lang.String> topics)
void
subscribe(java.util.Collection<java.lang.String> topics, ConsumerRebalanceListener callback)
void
subscribe(java.util.List<java.lang.String> topics)
void
subscribe(java.util.List<java.lang.String> topics, ConsumerRebalanceListener callback)
void
subscribe(java.util.regex.Pattern pattern)
void
subscribe(java.util.regex.Pattern pattern, ConsumerRebalanceListener callback)
java.util.Set<java.lang.String>
subscription()
void
unsubscribe()
void
wakeup()
-
-
-
Method Detail
-
assignment
java.util.Set<TopicPartition> assignment()
- See Also:
KafkaConsumer.assignment()
-
subscription
java.util.Set<java.lang.String> subscription()
- See Also:
KafkaConsumer.subscription()
-
subscribe
void subscribe(java.util.Collection<java.lang.String> topics)
- See Also:
KafkaConsumer.subscribe(Collection)
-
subscribe
void subscribe(java.util.List<java.lang.String> topics)
-
subscribe
void subscribe(java.util.Collection<java.lang.String> topics, ConsumerRebalanceListener callback)
-
subscribe
void subscribe(java.util.List<java.lang.String> topics, ConsumerRebalanceListener callback)
-
assign
void assign(java.util.Collection<TopicPartition> partitions)
- See Also:
KafkaConsumer.assign(Collection)
-
assign
void assign(java.util.List<TopicPartition> partitions)
-
subscribe
void subscribe(java.util.regex.Pattern pattern, ConsumerRebalanceListener callback)
-
subscribe
void subscribe(java.util.regex.Pattern pattern)
- See Also:
KafkaConsumer.subscribe(Pattern)
-
unsubscribe
void unsubscribe()
- See Also:
KafkaConsumer.unsubscribe()
-
poll
@Deprecated ConsumerRecords<K,V> poll(long timeout)
Deprecated.- See Also:
KafkaConsumer.poll(long)
-
poll
ConsumerRecords<K,V> poll(java.time.Duration timeout)
- See Also:
KafkaConsumer.poll(Duration)
-
commitSync
void commitSync()
- See Also:
KafkaConsumer.commitSync()
-
commitSync
void commitSync(java.time.Duration timeout)
- See Also:
KafkaConsumer.commitSync(Duration)
-
commitSync
void commitSync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets)
- See Also:
KafkaConsumer.commitSync(Map)
-
commitSync
void commitSync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, java.time.Duration timeout)
- See Also:
KafkaConsumer.commitSync(Map, Duration)
-
commitAsync
void commitAsync()
- See Also:
KafkaConsumer.commitAsync()
-
commitAsync
void commitAsync(OffsetCommitCallback callback)
-
commitAsync
void commitAsync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback callback)
-
seek
void seek(TopicPartition partition, long offset)
- See Also:
KafkaConsumer.seek(TopicPartition, long)
-
seek
void seek(TopicPartition partition, OffsetAndMetadata offsetAndMetadata)
-
seekToBeginning
void seekToBeginning(java.util.Collection<TopicPartition> partitions)
-
seekToBeginning
@Deprecated void seekToBeginning(TopicPartition... partitions)
Deprecated.
-
seekToEnd
void seekToEnd(java.util.Collection<TopicPartition> partitions)
- See Also:
KafkaConsumer.seekToEnd(Collection)
-
seekToEnd
@Deprecated void seekToEnd(TopicPartition... partitions)
Deprecated.
-
position
long position(TopicPartition partition)
- See Also:
KafkaConsumer.position(TopicPartition)
-
position
long position(TopicPartition partition, java.time.Duration timeout)
-
committed
@Deprecated OffsetAndMetadata committed(TopicPartition partition)
Deprecated.- See Also:
KafkaConsumer.committed(TopicPartition)
-
committed
@Deprecated OffsetAndMetadata committed(TopicPartition partition, java.time.Duration timeout)
Deprecated.
-
committed
java.util.Map<TopicPartition,OffsetAndMetadata> committed(java.util.Set<TopicPartition> partitions)
- See Also:
KafkaConsumer.committed(Set)
-
committed
java.util.Map<TopicPartition,OffsetAndMetadata> committed(java.util.Set<TopicPartition> partitions, java.time.Duration timeout)
- See Also:
KafkaConsumer.committed(Set, Duration)
-
metrics
java.util.Map<MetricName,? extends Metric> metrics()
- See Also:
KafkaConsumer.metrics()
-
partitionsFor
java.util.List<PartitionInfo> partitionsFor(java.lang.String topic)
- See Also:
KafkaConsumer.partitionsFor(String)
-
partitionsFor
java.util.List<PartitionInfo> partitionsFor(java.lang.String topic, java.time.Duration timeout)
-
listTopics
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics()
- See Also:
KafkaConsumer.listTopics()
-
listTopics
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics(java.time.Duration timeout)
- See Also:
KafkaConsumer.listTopics(Duration)
-
paused
java.util.Set<TopicPartition> paused()
- See Also:
KafkaConsumer.paused()
-
pause
void pause(java.util.Collection<TopicPartition> partitions)
- See Also:
KafkaConsumer.pause(Collection)
-
pause
@Deprecated void pause(TopicPartition... partitions)
Deprecated.
-
listTopics
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics(java.util.regex.Pattern pattern)
- See Also:
KafkaConsumer.listTopics(Pattern)
-
resume
void resume(java.util.Collection<TopicPartition> partitions)
- See Also:
KafkaConsumer.resume(Collection)
-
offsetsForTimes
java.util.Map<TopicPartition,OffsetAndTimestamp> offsetsForTimes(java.util.Map<TopicPartition,java.lang.Long> timestampsToSearch)
- See Also:
KafkaConsumer.offsetsForTimes(Map)
-
resume
@Deprecated void resume(TopicPartition... partitions)
Deprecated.
-
offsetsForTimes
java.util.Map<TopicPartition,OffsetAndTimestamp> offsetsForTimes(java.util.Map<TopicPartition,java.lang.Long> timestampsToSearch, java.time.Duration timeout)
-
beginningOffsets
java.util.Map<TopicPartition,java.lang.Long> beginningOffsets(java.util.Collection<TopicPartition> partitions)
-
beginningOffsets
java.util.Map<TopicPartition,java.lang.Long> beginningOffsets(java.util.Collection<TopicPartition> partitions, java.time.Duration timeout)
-
endOffsets
java.util.Map<TopicPartition,java.lang.Long> endOffsets(java.util.Collection<TopicPartition> partitions)
- See Also:
KafkaConsumer.endOffsets(Collection)
-
endOffsets
java.util.Map<TopicPartition,java.lang.Long> endOffsets(java.util.Collection<TopicPartition> partitions, java.time.Duration timeout)
-
listTopics
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics(java.lang.String stream)
- See Also:
KafkaConsumer.listTopics(String)
-
listTopics
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics(java.lang.String stream, java.time.Duration timeout)
-
groupMetadata
ConsumerGroupMetadata groupMetadata()
- See Also:
KafkaConsumer.groupMetadata()
-
enforceRebalance
void enforceRebalance()
- See Also:
KafkaConsumer.enforceRebalance()
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- See Also:
KafkaConsumer.close()
-
close
@Deprecated void close(long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.- See Also:
KafkaConsumer.close(long, TimeUnit)
-
close
void close(java.time.Duration timeout)
- See Also:
KafkaConsumer.close(Duration)
-
wakeup
void wakeup()
- See Also:
KafkaConsumer.wakeup()
-
-