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
public static interface KafkaCluster.InteractiveProducer<K,V> extends Closeable
A simple interactive Kafka producer for use with the cluster.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Close this producer's connection to Kafka and clean up all resources.default KafkaCluster.InteractiveProducer<K,V>write(String topic, K key, V value)Write to the topic with the given name a record with the specified key and value.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.
-
-
-
Method Detail
-
write
default KafkaCluster.InteractiveProducer<K,V> write(String topic, K key, V value)
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
-
-