Class: KafkaProducer

vertx-kafka-client-js/kafka_producer~ KafkaProducer

new KafkaProducer()

Vert.x Kafka producer.

Source:

Methods

close(timeout, completionHandler)

Close the producer
Parameters:
Name Type Description
timeout number timeout to wait for closing
completionHandler function handler called on operation completed
Source:

drainHandler(handler) → {KafkaProducer}

Parameters:
Name Type Description
handler function
Source:
Returns:
Type
KafkaProducer

end(kafkaProducerRecord)

Parameters:
Name Type Description
kafkaProducerRecord KafkaProducerRecord
Source:

exceptionHandler(handler) → {KafkaProducer}

Parameters:
Name Type Description
handler function
Source:
Returns:
Type
KafkaProducer

flush(completionHandler) → {KafkaProducer}

Invoking this method makes all buffered records immediately available to write
Parameters:
Name Type Description
completionHandler function handler called on operation completed
Source:
Returns:
current KafkaProducer instance
Type
KafkaProducer

partitionsFor(topic, handler) → {KafkaProducer}

Get the partition metadata for the give topic.
Parameters:
Name Type Description
topic string topic partition for which getting partitions info
handler function handler called on operation completed
Source:
Returns:
current KafkaProducer instance
Type
KafkaProducer

setWriteQueueMaxSize(i) → {KafkaProducer}

Parameters:
Name Type Description
i number
Source:
Returns:
Type
KafkaProducer

write(record, handler) → {KafkaProducer}

Asynchronously write a record to a topic
Parameters:
Name Type Description
record KafkaProducerRecord record to write
handler function handler called on operation completed
Source:
Returns:
current KafkaWriteStream instance
Type
KafkaProducer

writeQueueFull() → {boolean}

Source:
Returns:
Type
boolean