These are chat archives for arnaud-lb/php-rdkafka

2nd
Oct 2017
Jan051297
@Jan051297
Oct 02 2017 09:24
Here ist my problem:
```
Trying to get property of non-object in
$producer = new RdKafka\Producer();

$producer->setLogLevel(LOG_DEBUG);

$producer->addBrokers("192.168.110.30");

$topic = $producer->newTopic("test");
$topic->produce(1, 0, "Test");
$consumer = new RdKafka\Consumer();
$consumer->setLogLevel(LOG_DEBUG);
$consumer->addBrokers("192.168.110.30");

$topic2 = $consumer->newTopic('test4');
$topic2->consumeStart(1, RD_KAFKA_OFFSET_BEGINNING);

while (true) {
    try {
        $msg = $topic2->consume(1, 1000);
        if ($msg->err) {
            echo $msg->errstr(), "\n";
            break;
        } else {
            echo $msg->payload, "\n";
        }
    }catch (\Exception $exception) {
        var_dump($exception);
    }
}
when i change the partion the error occured
jstean
@jstean
Oct 02 2017 13:05
@edenhill I have a topic TEST with 1 replica and 10 partitions, producing on RD_KAFKA_PARTITION_UA and consuming using rdkafka high level consumer ( no partition specified ). Topic TEST has 5 subscribers who each have their own unique consumer group id , when I send message A on topic test, maybe 4 will get the message. When I send message B, maybe 5 will get the message. When I send message C maybe 2 will get it, maybe 3 or 4. I expect all 5 to get the message every time as they are subscribe using different group.id? am I making wrong assumptions?
@Jan051297 can you highlight the line number you're getting that error on?
Jan051297
@Jan051297
Oct 02 2017 15:06
here
$msg = $topic2->consume(1, 1000);
            echo $msg->errstr(), "\n";
jstean
@jstean
Oct 02 2017 15:49
@Jan051297 so the $msg is not an object - maybe if your topic only has 1 partition ( partition 0 ) ?
Jan051297
@Jan051297
Oct 02 2017 16:06
with 0 it should be work, but how can i make it work wih more than 1 partition ?