vertx / io.vertx.rxjava.kafka.client.producer / KafkaProducer / createShared

createShared

open static fun <K : Any, V : Any> createShared(vertx: Vertx, name: String, config: MutableMap<String, String>): KafkaProducer<K, V>

Get or create a KafkaProducer instance which shares its stream with any other KafkaProducer created with the same name

Parameters

vertx - Vert.x instance to use

name - the producer name to identify it

config - Kafka producer configuration

Return
an instance of the KafkaProducer

open static fun <K : Any, V : Any> createShared(vertx: Vertx, name: String, config: MutableMap<String, String>, keyType: Class<K>, valueType: Class<V>): KafkaProducer<K, V>

Get or create a KafkaProducer instance which shares its stream with any other KafkaProducer created with the same name

Parameters

vertx - Vert.x instance to use

name - the producer name to identify it

config - Kafka producer configuration

keyType - class type for the key serialization

valueType - class type for the value serialization

Return
an instance of the KafkaProducer