librdkafka
The Apache Kafka C/C++ client library
RdKafka::Event Class Referenceabstract

Event object class as passed to the EventCb callback. More...

#include <rdkafkacpp.h>

Public Types

enum  Type {
  EVENT_ERROR ,
  EVENT_STATS ,
  EVENT_LOG ,
  EVENT_THROTTLE
}
 Event type. More...
 
enum  Severity {
  EVENT_SEVERITY_EMERG = 0 ,
  EVENT_SEVERITY_ALERT = 1 ,
  EVENT_SEVERITY_CRITICAL = 2 ,
  EVENT_SEVERITY_ERROR = 3 ,
  EVENT_SEVERITY_WARNING = 4 ,
  EVENT_SEVERITY_NOTICE = 5 ,
  EVENT_SEVERITY_INFO = 6 ,
  EVENT_SEVERITY_DEBUG = 7
}
 EVENT_LOG severities (conforms to syslog(3) severities)
 

Public Member Functions

virtual Type type () const =0
 
virtual ErrorCode err () const =0
 
virtual Severity severity () const =0
 
virtual std::string fac () const =0
 
virtual std::string str () const =0
 
virtual int throttle_time () const =0
 
virtual std::string broker_name () const =0
 
virtual int broker_id () const =0
 
virtual bool fatal () const =0
 

Detailed Description

Event object class as passed to the EventCb callback.

Member Enumeration Documentation

◆ Type

Event type.

Enumerator
EVENT_ERROR 

Event is an error condition

EVENT_STATS 

Event is a statistics JSON document

EVENT_LOG 

Event is a log message

EVENT_THROTTLE 

Event is a throttle level signaling from the broker

Member Function Documentation

◆ type()

virtual Type RdKafka::Event::type ( ) const
pure virtual
Returns
The event type
Remarks
Applies to all event types

◆ err()

virtual ErrorCode RdKafka::Event::err ( ) const
pure virtual
Returns
Event error, if any.
Remarks
Applies to all event types except THROTTLE

◆ severity()

virtual Severity RdKafka::Event::severity ( ) const
pure virtual
Returns
Log severity level.
Remarks
Applies to LOG event type.

◆ fac()

virtual std::string RdKafka::Event::fac ( ) const
pure virtual
Returns
Log facility string.
Remarks
Applies to LOG event type.

◆ str()

virtual std::string RdKafka::Event::str ( ) const
pure virtual
Returns
Log message string.

EVENT_LOG: Log message string. EVENT_STATS: JSON object (as string).

Remarks
Applies to LOG event type.

◆ throttle_time()

virtual int RdKafka::Event::throttle_time ( ) const
pure virtual
Returns
Throttle time in milliseconds.
Remarks
Applies to THROTTLE event type.

◆ broker_name()

virtual std::string RdKafka::Event::broker_name ( ) const
pure virtual
Returns
Throttling broker's name.
Remarks
Applies to THROTTLE event type.

◆ broker_id()

virtual int RdKafka::Event::broker_id ( ) const
pure virtual
Returns
Throttling broker's id.
Remarks
Applies to THROTTLE event type.

◆ fatal()

virtual bool RdKafka::Event::fatal ( ) const
pure virtual
Returns
true if this is a fatal error.
Remarks
Applies to ERROR event type.
See also
RdKafka::Handle::fatal_error()

The documentation for this class was generated from the following file: