librdkafka
The Apache Kafka C/C++ client library
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, ConsumeCb *consume_cb, std::string &errstr)=0
 Use with name = "consume_cb".
 
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.
 

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

§ ConfType

Configuration object type.

Enumerator
CONF_GLOBAL 

Global configuration

CONF_TOPIC 

Topic specific configuration

§ ConfResult

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

§ set() [1/2]

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.

§ set() [2/2]

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()

§ get() [1/9]

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.

§ get() [2/9]

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.

§ get() [3/9]

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.

§ get() [4/9]

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.

§ get() [5/9]

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.

§ get() [6/9]

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.

§ get() [7/9]

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.

§ get() [8/9]

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.

§ get() [9/9]

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: