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 Conf::ConfResult get (DeliveryReportCb *&dr_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (EventCb *&event_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (PartitionerCb *&partitioner_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (PartitionerKeyPointerCb *&partitioner_kp_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (SocketCb *&socket_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (OpenCb *&open_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (RebalanceCb *&rebalance_cb) const =0
 Query single configuration value. More...
 
virtual Conf::ConfResult get (OffsetCommitCb *&offset_commit_cb) 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.
 
virtual Conf::ConfResult set (const std::string &name, ConsumeCb *consume_cb, std::string &errstr)=0
 Use with name = "consume_cb".
 

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.

Fallthrough: Topic-level configuration properties may be set using this interface in which case they are applied on the default_topic_conf. If no default_topic_conf has been set one will be created. Any sub-sequent set("default_topic_conf", ..) calls will replace the current default topic configuration.

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.

Do not use this method to get callbacks registered by the configuration file. Instead use the specific get() methods with the specific callback parameter in the signature.

Fallthrough: Topic-level configuration properties from the default_topic_conf may be retrieved using this interface.

Returns
CONF_OK if the property was set previously set and returns the value in value.
virtual Conf::ConfResult RdKafka::Conf::get ( DeliveryReportCb *&  dr_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in dr_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( EventCb *&  event_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in event_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( PartitionerCb *&  partitioner_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in partitioner_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( PartitionerKeyPointerCb *&  partitioner_kp_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in partitioner_kp_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( SocketCb *&  socket_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in socket_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( OpenCb *&  open_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in open_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( RebalanceCb *&  rebalance_cb) const
pure virtual

Query single configuration value.

Returns
CONF_OK if the property was set previously set and returns the value in rebalance_cb.
virtual Conf::ConfResult RdKafka::Conf::get ( OffsetCommitCb *&  offset_commit_cb) const
pure virtual

Query single configuration value.

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

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