librdkafka
The Apache Kafka C/C++ client library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RdKafka::Conf Class Referenceabstract

Configuration interface. More...

#include <rdkafkacpp.h>

Public Types

enum  ConfType {
  CONF_GLOBAL,
  CONF_TOPIC
}
 Configuration object type. More...
 
enum  ConfResult {
  CONF_UNKNOWN = -2,
  CONF_INVALID = -1,
  CONF_OK = 0
}
 RdKafka::Conf::Set() result code. More...
 

Public Member Functions

virtual Conf::ConfResult set (const std::string &name, const std::string &value, std::string &errstr)=0
 Set configuration property name to value value. More...
 
virtual Conf::ConfResult set (const std::string &name, DeliveryReportCb *dr_cb, std::string &errstr)=0
 Use with name = "dr_cb".
 
virtual Conf::ConfResult set (const std::string &name, EventCb *event_cb, std::string &errstr)=0
 Use with name = "event_cb".
 
virtual Conf::ConfResult set (const std::string &name, const Conf *topic_conf, std::string &errstr)=0
 Use with name = "default_topic_conf". More...
 
virtual Conf::ConfResult set (const std::string &name, PartitionerCb *partitioner_cb, std::string &errstr)=0
 Use with name = "partitioner_cb".
 
virtual Conf::ConfResult set (const std::string &name, PartitionerKeyPointerCb *partitioner_kp_cb, std::string &errstr)=0
 Use with name = "partitioner_key_pointer_cb".
 
virtual Conf::ConfResult set (const std::string &name, SocketCb *socket_cb, std::string &errstr)=0
 Use with name = "socket_cb".
 
virtual Conf::ConfResult set (const std::string &name, OpenCb *open_cb, std::string &errstr)=0
 Use with name = "open_cb".
 
virtual Conf::ConfResult set (const std::string &name, RebalanceCb *rebalance_cb, std::string &errstr)=0
 Use with name = "rebalance_cb".
 
virtual Conf::ConfResult set (const std::string &name, OffsetCommitCb *offset_commit_cb, std::string &errstr)=0
 Use with name = "offset_commit_cb".
 
virtual Conf::ConfResult get (const std::string &name, std::string &value) const =0
 Query single configuration value. More...
 
virtual std::list< std::string > * dump ()=0
 Dump configuration names and values to list containing name,value tuples.
 

Static Public Member Functions

static Confcreate (ConfType type)
 Create configuration object.
 

Detailed Description

Configuration interface.

Holds either global or topic configuration that are passed to RdKafka::Consumer::create(), RdKafka::Producer::create(), RdKafka::KafkaConsumer::create(), etc.

See also
CONFIGURATION.md for the full list of supported properties.

Member Enumeration Documentation

Configuration object type.

Enumerator
CONF_GLOBAL 

Global configuration

CONF_TOPIC 

Topic specific configuration

RdKafka::Conf::Set() result code.

Enumerator
CONF_UNKNOWN 

Unknown configuration property

CONF_INVALID 

Invalid configuration value

CONF_OK 

Configuration property was succesfully set

Member Function Documentation

virtual Conf::ConfResult RdKafka::Conf::set ( const std::string &  name,
const std::string &  value,
std::string &  errstr 
)
pure virtual

Set configuration property name to value value.

Returns
CONF_OK on success, else writes a human readable error description to errstr on error.
virtual Conf::ConfResult RdKafka::Conf::set ( const std::string &  name,
const Conf topic_conf,
std::string &  errstr 
)
pure virtual

Use with name = "default_topic_conf".

Sets the default topic configuration to use for for automatically subscribed topics.

See also
RdKafka::KafkaConsumer::subscribe()
virtual Conf::ConfResult RdKafka::Conf::get ( const std::string &  name,
std::string &  value 
) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in value.

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