librdkafka icon indicating copy to clipboard operation
librdkafka copied to clipboard

APIv2: Changes in the next version of the API

Open edenhill opened this issue 11 years ago • 2 comments

This is a summary of changes that should go into the next version of the API (SONAME version 2).

C

  • Replace all error codes (rd_kafka_resp_err_t) with error objects (rd_kafka_error_t *).
  • Rename error_cb to event_cb - usable both for events and errors.
  • Provide a severity level in event_cb to let the application know the severity of the error.
  • Move log_cb to event_cb.
  • Logs, errors and events are all events and shall be treated equally through the event_cb.
  • Decomission all uses of errno. Consistently return error objects from all relevant functions.
  • Remove dr_cb.
  • Add flags field to rd_kafka_message_t, see issue #112
  • Add opaque to rd_kafka_message_t
  • Add errstr to rd_kafka_message_t, cant reuse payload in dr_cb.
  • Make rd_kafka_message_t a private type
  • Remove legacy consumer.
  • Add a richer error type that contains severity. ✅

C++

  • ABI safe design

General

  • Make murmur2_random the default partitioner to be consistent with Java producer.
  • Remove legacy configuration properties, such as the topic-level auto.commit.enable that is often confused with the new consumer enable.auto.commit

edenhill avatar Jan 30 '14 02:01 edenhill

As part of #1, would you consider converging/moving the logging callback into event_cb? If you think about it, a log represents information about an event. It would be good to: - be able to subscribe to event callbacks of a certain type and/or minimum severity - when the user receives the callback, they can choose to either ignore it, log it or do act on it.

winbatch avatar Jan 30 '14 11:01 winbatch

Sounds like a good idea. Logging is a bit weird today because it is decoupled from the config object where everything else is set.

And as you say, all these things are really the same thing: errors, logs and events,

edenhill avatar Jan 30 '14 11:01 edenhill