Vert.x Kafka producer.
The provides global control over writing a record.
package |
Default |
---|
__construct()
close( $arg0 = null, $arg1 = null) : void
close()
Close the producer
param $completionHandler [callable] handler called on operation completed close($completionHandler)
Close the producer
param $timeout [integer] timeout to wait for closing param $completionHandler [callable] handler called on operation completed close($timeout, $completionHandler)
callable | integer
callable
create( $arg0, $arg1, $arg2 = null, $arg3 = null) : \io\vertx\jphp\kafka\client\producer\KafkaProducer<K,V>
param $vertx [Vertx] Vert.x instance to use param $config [array] Kafka producer configuration create($vertx, $config)
Create a new KafkaProducer instance
param $vertx [Vertx] Vert.x instance to use param $config [array] Kafka producer configuration param $keyType [string] class type for the key serialization param $valueType [string] class type for the value serialization create($vertx, $config, $keyType, $valueType)
Vertx
array
string
string
\io\vertx\jphp\kafka\client\producer\KafkaProducer
an instance of the KafkaProducer
createShared( $arg0, $arg1, $arg2, $arg3 = null, $arg4 = null) : \io\vertx\jphp\kafka\client\producer\KafkaProducer<K,V>
param $vertx [Vertx] Vert.x instance to use param $name [string] the producer name to identify it param $config [array] Kafka producer configuration createShared($vertx, $name, $config)
Get or create a KafkaProducer instance which shares its stream with any other KafkaProducer created with the same name
param $vertx [Vertx] Vert.x instance to use param $name [string] the producer name to identify it param $config [array] Kafka producer configuration param $keyType [string] class type for the key serialization param $valueType [string] class type for the value serialization createShared($vertx, $name, $config, $keyType, $valueType)
Vertx
string
array
string
string
\io\vertx\jphp\kafka\client\producer\KafkaProducer
an instance of the KafkaProducer
drainHandler( $arg0) : $this
callable
$this
end( $arg0, $arg1 = null) : void
param $handler [callable] end($handler)
Same as but with an handler
called when the operation completes
param $data [KafkaProducerRecord<K,V>] param $handler [callable] end($data, $handler)
callable | KafkaProducerRecord<K,V>
callable
exceptionHandler( $arg0) : $this
callable
$this
flush( $arg0) : $this
callable
$this
current KafkaProducer instance
partitionsFor( $arg0, $arg1) : $this
string
callable
$this
current KafkaProducer instance
send( $arg0, $arg1 = null) : $this
param $record [KafkaProducerRecord<K,V>] record to write send($record)
Asynchronously write a record to a topic
param $record [KafkaProducerRecord<K,V>] record to write param $handler [callable] handler called on operation completed send($record, $handler)
KafkaProducerRecord<K,V>
callable
$this
current KafkaWriteStream instance
setWriteQueueMaxSize( $arg0) : $this
integer
$this
write( $arg0, $arg1) : void
KafkaProducerRecord<K,V>
callable
writeQueueFull() : boolean
boolean