Interface Producer<K,V>
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
KafkaProducer
,MockProducer
The interface for the
KafkaProducer
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clientInstanceId
(Duration timeout) void
close()
void
void
void
flush()
void
Map<MetricName,
? extends Metric> metrics()
partitionsFor
(String topic) send
(ProducerRecord<K, V> record) send
(ProducerRecord<K, V> record, Callback callback) void
sendOffsetsToTransaction
(Map<TopicPartition, OffsetAndMetadata> offsets, String consumerGroupId) Deprecated.void
sendOffsetsToTransaction
(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata)
-
Method Details
-
initTransactions
void initTransactions() -
beginTransaction
- Throws:
ProducerFencedException
-
sendOffsetsToTransaction
@Deprecated void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, String consumerGroupId) throws ProducerFencedExceptionDeprecated.- Throws:
ProducerFencedException
-
sendOffsetsToTransaction
void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException- Throws:
ProducerFencedException
-
commitTransaction
- Throws:
ProducerFencedException
-
abortTransaction
- Throws:
ProducerFencedException
-
send
-
send
-
flush
void flush() -
partitionsFor
-
metrics
Map<MetricName,? extends Metric> metrics() -
clientInstanceId
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
close
-