(PECL rdkafka >= 4.1.0, librdkafka >= 1.4.0)
RdKafka\Producer::beginTransaction — Begin a transaction
RdKafka\Producer::initTransactions() must have been called successfully (once) before this function is called. Any messages produced, offsets sent, etc, after the successful return of this function will be part of the transaction and committed or aborted atomatically. Finish the transaction by calling RdKafka\Producer::commitTransaction() or abort the transaction by calling RdKafka\Producer::abortTransaction().
In case of success returns NULL, in case of error a RdKafka\KafkaErrorException will be thrown.