confluentinc / librdkafka

The Apache Kafka C/C++ library
Other
7.36k stars 3.11k forks source link

Suppress EOF errors - only from logs #4704

Open pushkarmoi opened 1 month ago

pushkarmoi commented 1 month ago

Read the FAQ first: https://github.com/confluentinc/librdkafka/wiki/FAQ

Do NOT create issues for questions, use the discussion forum: https://github.com/confluentinc/librdkafka/discussions

Description

I'd like to treat EOF as an error (i.e. set enable.partition.eof to true) in my kafka consumer but not log it as one - is it doable?

ERROR rdkafka::client librdkafka: Global error: PartitionEOF

Logging configuration only allows me to change the default log level - which will suppress all ERROR level messages. Can certain types of ERRORS be selectively suppressed?

How to reproduce

Open a consumer on an empty stream and poll

Checklist

IMPORTANT: We will close issues where the checklist has not been completed.

Please provide the following information:

rolandyoung commented 1 month ago

Are those version numbers for librdkafka and Apache Kafka correct? They seem very old indeed. Free support for librdkafka is generally available only for the current version. You should also note that the template you have filled in explicitly says "Do NOT create issues for questions, use the discussion forum" - you can probably expect to wait a long time to be answered by one of the project team.

Having said that, the answer to your question will depend on how you log errors in your application.

(Note: I am not a member of the librdkafka project, I am answering as a fellow user of librdkafka)