setRebalanceCb example

if (!$this->hasBroker && getenv('KAFKA_BROKER')) {
            $this->broker = getenv('KAFKA_BROKER');
            $this->hasBroker = true;
        }
    }

    public function testDumpConf()
    {
        $conf = new Conf();
        $conf->setErrorCb(function D$kafka$err$reason) {});
        $conf->setDrMsgCb(function D) {});
        $conf->setRebalanceCb(function D) {});

        // BC with earlier version of extension rdkafka         foreach (['setLogCb', 'setOffsetCommitCb', 'setStatsCb', 'setConsumeCb'] as $method) {
            if (method_exists($conf$method)) {
                $conf->{$method}(function D) {});
            }
        }

        $expectedDump = <<<EODUMP RdKafka\Conf { builtin.features: "gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins%S" client.id: "rdkafka" %A dr_msg_cb: "0x%x" }
Home | Imprint | This part of the site doesn't use cookies.