I made an error in my hostname but the process keep going without exiting so I was not aware I made this error. Librdkafka just logs messages without raising an error :
%3|1622636859.368|FAIL|rdkafka#consumer-1| [thrd:kafka:19092/bootstrap]: kafka:19092/bootstrap: Failed to resolve 'kafka:19092': Name does not resolve (after 2ms in state CONNECT)
%3|1622636859.368|ERROR|rdkafka#consumer-1| [thrd:kafka:19092/bootstrap]: kafka:19092/bootstrap: Failed to resolve 'kafka:19092': Name does not resolve (after 2ms in state CONNECT)
%3|1622636859.368|ERROR|rdkafka#consumer-1| [thrd:kafka:19092/bootstrap]: 1/1 brokers are down
The KafkaConf object should implements the setErrorCb method to raise Exception on blocking ones.
^ "Local: Host resolution failure"
^ -193
^ "kafka:19092/bootstrap: Failed to resolve 'kafka:19092': Name does not resolve (after 3ms in state CONNECT)"
^ "Local: All broker connections are down"
^ -187
^ "1/1 brokers are down"
I think a simple switch case on blocking error code and a raised Exception should do the trick like you did for the rebalanceCb
I made an error in my hostname but the process keep going without exiting so I was not aware I made this error. Librdkafka just logs messages without raising an error :
The KafkaConf object should implements the
setErrorCb
method to raise Exception on blocking ones.https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka-conf.seterrorcb.html
Example :
Outputs for the same error previously :
I think a simple switch case on blocking error code and a raised Exception should do the trick like you did for the rebalanceCb