Skip to content

Commit

Permalink
test: fix controller_id
Browse files Browse the repository at this point in the history
  • Loading branch information
qkdreyer committed Jul 15, 2024
1 parent de55014 commit 6e96887
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/controller_id.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,16 @@ RD_KAFKA_BUILD_VERSION < 0x000b0500 && die("skip librdkafka < 0.11.5");
require __DIR__ . '/integration-tests-check.php';

$conf = new RdKafka\Conf();
if (RD_KAFKA_VERSION >= 0x090000 && false !== getenv('TEST_KAFKA_BROKER_VERSION')) {
$conf->set('broker.version.fallback', getenv('TEST_KAFKA_BROKER_VERSION'));
}
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));

$conf->setDrMsgCb(function ($rdkafka, $msg) {
var_dump($rdkafka, $msg);
});
echo (new RdKafka\Producer($conf))->getControllerId(0) . \PHP_EOL;
echo (new RdKafka\Consumer($conf))->getControllerId(0) . \PHP_EOL;

$producer = new RdKafka\Producer($conf);
$consumer = new RdKafka\Consumer($conf);
$kafkaConsumer = new RdKafka\KafkaConsumer($conf);
$conf = new RdKafka\Conf();
$conf->set('metadata.broker.list', getenv('TEST_KAFKA_BROKERS'));
$conf->set('group.id', 'test');

echo $producer->getControllerId() . \PHP_EOL;
echo $consumer->getControllerId() . \PHP_EOL;
echo $kafkaConsumer->getControllerId() . \PHP_EOL;
echo (new RdKafka\KafkaConsumer($conf))->getControllerId(0) . \PHP_EOL;
--EXPECT--
1
1
Expand Down

0 comments on commit 6e96887

Please sign in to comment.