[−][src]Trait rdkafka::client::ClientContext
Client-level context.
Each client (consumers and producers included) has a context object that can
be used to customize its behavior. Implementing ClientContext
enables the
customization of methods common to all clients, while ProducerContext
and ConsumerContext
are specific to producers and consumers. Refer to
the list of methods to see which callbacks can currently be overridden.
Important: implementations of ClientContext
must be thread safe, as
they might be shared between multiple threads.
Provided methods
fn log(&self, level: RDKafkaLogLevel, fac: &str, log_message: &str)
Receives log lines from librdkafka.
The default implementation forwards the log lines to the appropriate
log
crate macro. Consult the RDKafkaLogLevel
documentation for
details about the log level mapping.
fn stats(&self, statistics: Statistics)
Receives the statistics of the librdkafka client. To enable, the
statistics.interval.ms
configuration parameter must be specified.
The default implementation logs the statistics at the info
log level.
fn error(&self, error: KafkaError, reason: &str)
Receives global errors from the librdkafka client.
The default implementation logs the error at the error
log level.