
org.apache.kafka.clients.consumer.Consumer Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
* file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.kafka.clients.consumer;
import org.apache.kafka.common.Metric;
import org.apache.kafka.common.MetricName;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;
import java.io.Closeable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
/**
* @see KafkaConsumer
* @see MockConsumer
*/
public interface Consumer extends Closeable {
/**
* @see KafkaConsumer#assignment()
*/
public Set assignment();
/**
* @see KafkaConsumer#subscription()
*/
public Set subscription();
/**
* @see KafkaConsumer#subscribe(Collection)
*/
public void subscribe(Collection topics);
/**
* @see KafkaConsumer#subscribe(Collection, ConsumerRebalanceListener)
*/
public void subscribe(Collection topics, ConsumerRebalanceListener callback);
/**
* @see KafkaConsumer#assign(Collection)
*/
public void assign(Collection partitions);
/**
* @see KafkaConsumer#subscribe(Pattern, ConsumerRebalanceListener)
*/
public void subscribe(Pattern pattern, ConsumerRebalanceListener callback);
/**
* @see KafkaConsumer#unsubscribe()
*/
public void unsubscribe();
/**
* @see KafkaConsumer#poll(long)
*/
public ConsumerRecords poll(long timeout);
/**
* @see KafkaConsumer#commitSync()
*/
public void commitSync();
/**
* @see KafkaConsumer#commitSync(Map)
*/
public void commitSync(Map offsets);
/**
* @see KafkaConsumer#commitAsync()
*/
public void commitAsync();
/**
* @see KafkaConsumer#commitAsync(OffsetCommitCallback)
*/
public void commitAsync(OffsetCommitCallback callback);
/**
* @see KafkaConsumer#commitAsync(Map, OffsetCommitCallback)
*/
public void commitAsync(Map offsets, OffsetCommitCallback callback);
/**
* @see KafkaConsumer#seek(TopicPartition, long)
*/
public void seek(TopicPartition partition, long offset);
/**
* @see KafkaConsumer#seekToBeginning(Collection)
*/
public void seekToBeginning(Collection partitions);
/**
* @see KafkaConsumer#seekToEnd(Collection)
*/
public void seekToEnd(Collection partitions);
/**
* @see KafkaConsumer#position(TopicPartition)
*/
public long position(TopicPartition partition);
/**
* @see KafkaConsumer#committed(TopicPartition)
*/
public OffsetAndMetadata committed(TopicPartition partition);
/**
* @see KafkaConsumer#metrics()
*/
public Map metrics();
/**
* @see KafkaConsumer#partitionsFor(String)
*/
public List partitionsFor(String topic);
/**
* @see KafkaConsumer#listTopics()
*/
public Map> listTopics();
/**
* @see KafkaConsumer#paused()
*/
public Set paused();
/**
* @see KafkaConsumer#pause(Collection)
*/
public void pause(Collection partitions);
/**
* @see KafkaConsumer#resume(Collection)
*/
public void resume(Collection partitions);
/**
* @see KafkaConsumer#close()
*/
public void close();
/**
* @see KafkaConsumer#wakeup()
*/
public void wakeup();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy