interface KafkaProducer<K : Any, V : Any> : WriteStream<KafkaProducerRecord<K, V>>
Vert.x Kafka producer.
The #write(Object) provides global control over writing a record.
abstract fun asStream(): KafkaWriteStream<K, V> |
|
abstract fun close(): Unitabstract fun close(completionHandler: Handler<AsyncResult<Void>>): Unitabstract fun close(timeout: Long, completionHandler: Handler<AsyncResult<Void>>): Unit
Close the producer |
|
open static fun <K : Any, V : Any> create(vertx: Vertx, producer: Producer<K, V>): KafkaProducer<K, V>
Create a new KafkaProducer instance from a native Producer. open static fun <K : Any, V : Any> create(vertx: Vertx, config: MutableMap<String, String>): KafkaProducer<K, V>open static fun <K : Any, V : Any> create(vertx: Vertx, config: MutableMap<String, String>, keyType: Class<K>, valueType: Class<V>): KafkaProducer<K, V>open static fun <K : Any, V : Any> create(vertx: Vertx, config: Properties): KafkaProducer<K, V>open static fun <K : Any, V : Any> create(vertx: Vertx, config: Properties, keyType: Class<K>, valueType: Class<V>): KafkaProducer<K, V>
Create a new KafkaProducer instance |
|
open static fun <K : Any, V : Any> createShared(: Vertx, : String, : Properties): KafkaProducer<K, V>open static fun <K : Any, V : Any> createShared(: Vertx, : String, : MutableMap<String, String>): KafkaProducer<K, V>open static fun <K : Any, V : Any> createShared(: Vertx, : String, : MutableMap<String, String>, : Class<K>, : Class<V>): KafkaProducer<K, V>open static fun <K : Any, V : Any> createShared(: Vertx, : String, : Properties, : Class<K>, : Class<V>): KafkaProducer<K, V>
Get or create a KafkaProducer instance which shares its stream with any other KafkaProducer created with the same |
|
abstract fun drainHandler(handler: Handler<Void>): KafkaProducer<K, V> |
|
abstract fun end(): Unitabstract fun end(kafkaProducerRecord: KafkaProducerRecord<K, V>): Unit |
|
abstract fun exceptionHandler(handler: Handler<Throwable>): KafkaProducer<K, V> |
|
abstract fun flush(completionHandler: Handler<Void>): KafkaProducer<K, V>
Invoking this method makes all buffered records immediately available to write |
|
abstract fun partitionsFor(topic: String, handler: Handler<AsyncResult<MutableList<PartitionInfo>>>): KafkaProducer<K, V>
Get the partition metadata for the give topic. |
|
abstract fun setWriteQueueMaxSize(i: Int): KafkaProducer<K, V> |
|
abstract fun unwrap(): Producer<K, V> |
|
abstract fun write(kafkaProducerRecord: KafkaProducerRecord<K, V>): KafkaProducer<K, V>abstract fun write(record: KafkaProducerRecord<K, V>, handler: Handler<AsyncResult<RecordMetadata>>): KafkaProducer<K, V>
Asynchronously write a record to a topic |
|
abstract fun writeQueueFull(): Boolean |