Package io.debezium.kafka
Interface KafkaCluster.InteractiveProducer<K,V>
- Type Parameters:
K- the type of keyV- the type of value
- All Superinterfaces:
AutoCloseable,Closeable
- Enclosing class:
- KafkaCluster
A simple interactive Kafka producer for use with the cluster.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this producer's connection to Kafka and clean up all resources.default KafkaCluster.InteractiveProducer<K,V> Write to the topic with the given name a record with the specified key and value.Write the specified record to the topic with the given name.
-
Method Details
-
write
Write to the topic with the given name a record with the specified key and value. The message is flushed immediately.- Parameters:
topic- the name of the topic; may not be nullkey- the key; may not be nullvalue- the value; may not be null- Returns:
- this producer instance to allow chaining methods together
-
write
KafkaCluster.InteractiveProducer<K,V> write(org.apache.kafka.clients.producer.ProducerRecord<K, V> record) Write the specified record to the topic with the given name. The message is flushed immediately.- Parameters:
record- the record; may not be null- Returns:
- this producer instance to allow chaining methods together
-
close
void close()Close this producer's connection to Kafka and clean up all resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-