[][src]Trait rdkafka::client::ClientContext

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.

Loading content...

Implementors

impl ClientContext for DefaultClientContext[src]

fn log(&self, level: RDKafkaLogLevel, fac: &str, log_message: &str)[src]

fn stats(&self, statistics: Statistics)[src]

fn error(&self, error: KafkaError, reason: &str)[src]

impl ClientContext for DefaultConsumerContext[src]

fn log(&self, level: RDKafkaLogLevel, fac: &str, log_message: &str)[src]

fn stats(&self, statistics: Statistics)[src]

fn error(&self, error: KafkaError, reason: &str)[src]

impl ClientContext for DefaultProducerContext[src]

fn log(&self, level: RDKafkaLogLevel, fac: &str, log_message: &str)[src]

fn stats(&self, statistics: Statistics)[src]

fn error(&self, error: KafkaError, reason: &str)[src]

Loading content...