arnaud-lb / php-rdkafka

Production-ready, stable Kafka client for PHP
MIT License
2.08k stars 263 forks source link

How to catch "Local: Maximum application poll interval (max.poll.interval.ms) exceeded" error ? #470

Open askie opened 2 years ago

askie commented 2 years ago

my configuration:

<?php
$conf = new RdKafka\Conf();
// Add the two settings below for a more verbose output
$conf->set('log_level', (string) LOG_DEBUG);
$conf->set('debug', 'all');

 $conf->set('enable.auto.commit', 'false');
$conf->set('max.poll.interval.ms', 6000);

when callback function sleep more then 6000ms log show:

%4|1634714275.038|MAXPOLL|rdkafka#consumer-1| [thrd:main]: Application maximum poll interval (8000ms) exceeded by 494ms (adjust max.poll.interval.ms for long-running message processing): leaving group

and the $consumer is still working in CLI , how can I catch the error to restart $consumer in CLI ?

================== if set : $conf->set('enable.auto.commit', 'true');

when $consupmer exec more then 6000ms , will get a Exception: Local: Maximum application poll interval (max.poll.interval.ms) exceeded

this is what I want to catch.

chrisfield490 commented 1 year ago

I know this is two years ago, but i am running debian buster with: PHP 7.4.30 librdkafka 0.11.6-1.1 php-rdkafka 6.0.3 kafka_2.13.-2.8.0

We see the above error when running our php from the command line, we have left the code running for 30 mins without the script stopping, even though we can see the consumer has stopped the connection to the topic.

How do we get the script to end when throwing the exception?