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

<b> end() </b>

end( $arg0 = null) : void

param $kafkaProducerRecord [KafkaProducerRecord<K,V>] end($kafkaProducerRecord)

Arguments

$arg0

KafkaProducerRecord<K,V>

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

setWriteQueueMaxSize

setWriteQueueMaxSize( $arg0) : $this

Arguments

$arg0

integer

Response

$this

param $kafkaProducerRecord [KafkaProducerRecord<K,V>] <b> write($kafkaProducerRecord) </b>

write( $arg0,  $arg1 = null) : $this

Asynchronously write a record to a topic

param $record [KafkaProducerRecord<K,V>] record to write param $handler [callable] handler called on operation completed write($record, $handler)

Arguments

$arg0

KafkaProducerRecord<K,V>

$arg1

callable

Response

$this

writeQueueFull

writeQueueFull() : boolean

Response

boolean