java.lang.AutoCloseable
, java.io.Closeable
KafkaConsumer
, MockConsumer
public interface Consumer<K,V>
extends java.io.Closeable
KafkaConsumer
,
MockConsumer
Modifier and Type | Method | Description |
---|---|---|
void |
assign(java.util.Collection<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) |
|
OffsetAndMetadata |
committed(TopicPartition partition) |
|
OffsetAndMetadata |
committed(TopicPartition partition,
java.time.Duration timeout) |
|
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) |
|
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> |
listTopics() |
|
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> |
listTopics(java.time.Duration timeout) |
|
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) |
|
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 |
seek(TopicPartition partition,
long offset) |
|
void |
seekToBeginning(java.util.Collection<TopicPartition> partitions) |
|
void |
seekToEnd(java.util.Collection<TopicPartition> partitions) |
|
void |
subscribe(java.util.Collection<java.lang.String> topics) |
|
void |
subscribe(java.util.Collection<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() |
java.util.Set<TopicPartition> assignment()
KafkaConsumer.assignment()
java.util.Set<java.lang.String> subscription()
KafkaConsumer.subscription()
void subscribe(java.util.Collection<java.lang.String> topics)
KafkaConsumer.subscribe(Collection)
void subscribe(java.util.Collection<java.lang.String> topics, ConsumerRebalanceListener callback)
void assign(java.util.Collection<TopicPartition> partitions)
KafkaConsumer.assign(Collection)
void subscribe(java.util.regex.Pattern pattern, ConsumerRebalanceListener callback)
void subscribe(java.util.regex.Pattern pattern)
KafkaConsumer.subscribe(Pattern)
void unsubscribe()
KafkaConsumer.unsubscribe()
@Deprecated ConsumerRecords<K,V> poll(long timeout)
KafkaConsumer.poll(long)
ConsumerRecords<K,V> poll(java.time.Duration timeout)
KafkaConsumer.poll(Duration)
void commitSync()
KafkaConsumer.commitSync()
void commitSync(java.time.Duration timeout)
KafkaConsumer.commitSync(Duration)
void commitSync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets)
KafkaConsumer.commitSync(Map)
void commitSync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, java.time.Duration timeout)
KafkaConsumer.commitSync(Map, Duration)
void commitAsync()
KafkaConsumer.commitAsync()
void commitAsync(OffsetCommitCallback callback)
void commitAsync(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, OffsetCommitCallback callback)
void seek(TopicPartition partition, long offset)
KafkaConsumer.seek(TopicPartition, long)
void seekToBeginning(java.util.Collection<TopicPartition> partitions)
void seekToEnd(java.util.Collection<TopicPartition> partitions)
KafkaConsumer.seekToEnd(Collection)
long position(TopicPartition partition)
KafkaConsumer.position(TopicPartition)
long position(TopicPartition partition, java.time.Duration timeout)
OffsetAndMetadata committed(TopicPartition partition)
KafkaConsumer.committed(TopicPartition)
OffsetAndMetadata committed(TopicPartition partition, java.time.Duration timeout)
java.util.Map<MetricName,? extends Metric> metrics()
KafkaConsumer.metrics()
java.util.List<PartitionInfo> partitionsFor(java.lang.String topic)
KafkaConsumer.partitionsFor(String)
java.util.List<PartitionInfo> partitionsFor(java.lang.String topic, java.time.Duration timeout)
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics()
KafkaConsumer.listTopics()
java.util.Map<java.lang.String,java.util.List<PartitionInfo>> listTopics(java.time.Duration timeout)
KafkaConsumer.listTopics(Duration)
java.util.Set<TopicPartition> paused()
KafkaConsumer.paused()
void pause(java.util.Collection<TopicPartition> partitions)
KafkaConsumer.pause(Collection)
void resume(java.util.Collection<TopicPartition> partitions)
KafkaConsumer.resume(Collection)
java.util.Map<TopicPartition,OffsetAndTimestamp> offsetsForTimes(java.util.Map<TopicPartition,java.lang.Long> timestampsToSearch)
KafkaConsumer.offsetsForTimes(Map)
java.util.Map<TopicPartition,OffsetAndTimestamp> offsetsForTimes(java.util.Map<TopicPartition,java.lang.Long> timestampsToSearch, java.time.Duration timeout)
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)
java.util.Map<TopicPartition,java.lang.Long> endOffsets(java.util.Collection<TopicPartition> partitions)
KafkaConsumer.endOffsets(Collection)
java.util.Map<TopicPartition,java.lang.Long> endOffsets(java.util.Collection<TopicPartition> partitions, java.time.Duration timeout)
void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
KafkaConsumer.close()
@Deprecated void close(long timeout, java.util.concurrent.TimeUnit unit)
KafkaConsumer.close(long, TimeUnit)
void close(java.time.Duration timeout)
KafkaConsumer.close(Duration)
void wakeup()
KafkaConsumer.wakeup()