Trait rdkafka::client::ClientContext
[−]
[src]
pub trait ClientContext: Send + Sync { fn log(&self, level: RDKafkaLogLevel, fac: &str, log_message: &str) { ... } fn stats(&self, statistics: Statistics) { ... } fn error(&self, error: KafkaError, reason: &str) { ... } }
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. Implementations of ClientContext
must be thread safe, as they might be owned by
multiple threads.
Provided Methods
fn log(&self, level: RDKafkaLogLevel, fac: &str, log_message: &str)
Receives log lines from librdkafka.
fn stats(&self, statistics: Statistics)
Receives the statistics of the librdkafka client. To enable, the "statistics.interval.ms" configuration parameter must be specified.
fn error(&self, error: KafkaError, reason: &str)
Receives global errors from the librdkafka client.
Implementors
impl ClientContext for DefaultClientContext
impl ClientContext for DefaultConsumerContext
impl ClientContext for DefaultProducerContext