public interface Producer<K,V>
extends java.io.Closeable
KafkaProducer
KafkaProducer
,
MockProducer
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction()
|
void |
beginTransaction()
|
void |
close()
|
void |
close(java.time.Duration timeout)
|
default void |
close(long timeout,
java.util.concurrent.TimeUnit unit)
Deprecated.
|
void |
commitTransaction()
|
void |
flush()
|
void |
initTransactions()
|
java.util.Map<MetricName,? extends Metric> |
metrics()
|
java.util.List<PartitionInfo> |
partitionsFor(java.lang.String topic)
|
java.util.concurrent.Future<RecordMetadata> |
send(ProducerRecord<K,V> record)
|
java.util.concurrent.Future<RecordMetadata> |
send(ProducerRecord<K,V> record,
Callback callback)
|
void |
sendOffsetsToTransaction(java.util.Map<TopicPartition,OffsetAndMetadata> offsets,
java.lang.String consumerGroupId)
|
void initTransactions()
void beginTransaction() throws ProducerFencedException
ProducerFencedException
void sendOffsetsToTransaction(java.util.Map<TopicPartition,OffsetAndMetadata> offsets, java.lang.String consumerGroupId) throws ProducerFencedException
ProducerFencedException
void commitTransaction() throws ProducerFencedException
ProducerFencedException
void abortTransaction() throws ProducerFencedException
ProducerFencedException
java.util.concurrent.Future<RecordMetadata> send(ProducerRecord<K,V> record)
java.util.concurrent.Future<RecordMetadata> send(ProducerRecord<K,V> record, Callback callback)
void flush()
java.util.List<PartitionInfo> partitionsFor(java.lang.String topic)
java.util.Map<MetricName,? extends Metric> metrics()
void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
@Deprecated default void close(long timeout, java.util.concurrent.TimeUnit unit)
void close(java.time.Duration timeout)