-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Error handling
Magnus Edenhill edited this page Nov 10, 2015
·
6 revisions
Typically librdkafka hides any non-permanent errors from the application and handles them gracefully internally by retrying.
Permanent errors are handled in different ways:
- global errors, e.g., all brokers down, are passed to the error_cb and served through rd_kafka_poll() (RD_KAFKA_RESP_ERR__ALL_BROKERS_DOWN).
- Producer: message delivery failures (and success) are passed to the dr_cb/dr_msg_cb callback and served through rd_kafka_poll()
- Consumer: Consumer errors, such as mild notifications (PARTITION_EOF) or more serious errors are passed as rkmessage->err for the .._consume*() functions that return or pass an rd_kafka_message_t. This means that a producer application should be calling rd_kafka_poll() every now and then, and a consumer application should both consume messages (duh..) and call rd_kafka_poll() every now and then.