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