RdKafka\Producer::initTransactions

(PECL rdkafka >= 4.1.0, librdkafka >= 1.4.0)

RdKafka\Producer::initTransactionsInitialize transactions

Description

public RdKafka\Producer::initTransactions ( integer $timeout_ms ) : void

Initialize transactions for the producer instance. This function ensures any transactions initiated by previous instances of the producer with the same transactional.id are completed. If the previous instance failed with a transaction in progress the previous transaction will be aborted. This function needs to be called before any other transactional or produce functions are called when the transactional.id is configured.

Parameters

timeout_ms (integer)

Specifies the amount of time (in milliseconds) that the call will try to initialize transaction capability.

Return Values

In case of success returns NULL, in case of error a RdKafka\KafkaErrorException will be thrown.