Suppress EOF errors - only from logs
pushkarmoi opened this issue · comments
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:
- librdkafka version (release number or git tag):
0.36.0
- Apache Kafka version:
0.10.0
- librdkafka client configuration:
enable.partition.eof=true
- Operating system: macOS
- Provide logs (with
debug=..
as necessary) from librdkafka - Provide broker log excerpts
- Critical issue
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.
-
If you are using librdkafka directly, you will either be checking for an error after calling rd_kafka_consumer_poll or you will have implemented an error callback (error_cb); in either case you can modify your implementation to ignore this specific error. (See here for more details.)
-
If you are using a language binding (such as confluent-kafka-go or Perfect-Kafka), you will need to check the documentation for that binding or seek support from its developers.
(Note: I am not a member of the librdkafka project, I am answering as a fellow user of librdkafka)