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

RdKafka\Producer::commitTransactionCommit current transaction


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

Commit the current transaction (as started with RdKafka\Producer::beginTransaction()). Any outstanding messages will be flushed (delivered) before actually committing the transaction. If any of the outstanding messages fail permanently the current transaction will enter the abortable error state and this function will return an abortable error, in this case the application must call RdKafka\Producer::abortTransaction() before attempting a new transaction with RdKafka\Producer::beginTransaction().


timeout_ms (integer)

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

Return Values

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