KafkaProducer

Vert.x Kafka producer.

The provides global control over writing a record.

package

Default

Methods

__construct

__construct() 

Close the producer

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)

Arguments

$arg0

callable | integer

$arg1

callable

Create a new KafkaProducer instance

create( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\kafka\client\producer\KafkaProducer<K,V>
static

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)

Arguments

$arg0

Vertx

$arg1

array

$arg2

string

$arg3

string

Response

\io\vertx\jphp\kafka\client\producer\KafkaProducer

an instance of the KafkaProducer

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

createShared( $arg0,  $arg1,  $arg2,  $arg3 = null,  $arg4 = null) : \io\vertx\jphp\kafka\client\producer\KafkaProducer<K,V>
static

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)

Arguments

$arg0

Vertx

$arg1

string

$arg2

array

$arg3

string

$arg4

string

Response

\io\vertx\jphp\kafka\client\producer\KafkaProducer

an instance of the KafkaProducer

drainHandler

drainHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Same as @see \io\vertx\jphp\core\streams\WriteStream::end but with an <code>handler</code> called when the operation completes

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)

Arguments

$arg0

callable | KafkaProducerRecord<K,V>

$arg1

callable

exceptionHandler

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Invoking this method makes all buffered records immediately available to write

flush( $arg0) : $this

Arguments

$arg0

callable

Response

$this

current KafkaProducer instance

Get the partition metadata for the give topic.

partitionsFor( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

current KafkaProducer instance

Asynchronously write a record to a topic

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)

Arguments

$arg0

KafkaProducerRecord<K,V>

$arg1

callable

Response

$this

current KafkaWriteStream instance

setWriteQueueMaxSize

setWriteQueueMaxSize( $arg0) : $this

Arguments

$arg0

integer

Response

$this

write

write( $arg0,  $arg1) : void

Arguments

$arg0

KafkaProducerRecord<K,V>

$arg1

callable

writeQueueFull

writeQueueFull() : boolean

Response

boolean