librdkafka
The Apache Kafka C/C++ client library
|
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, OAuthBearerTokenRefreshCb *oauthbearer_token_refresh_cb, std::string &errstr)=0 |
Use with name = "oauthbearer_token_refresh_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 | set (const std::string &name, SslCertificateVerifyCb *ssl_cert_verify_cb, std::string &errstr)=0 |
Use with name = "ssl_cert_verify_cb" . More... | |
virtual Conf::ConfResult | set_ssl_cert (RdKafka::CertificateType cert_type, RdKafka::CertificateEncoding cert_enc, const void *buffer, size_t size, std::string &errstr)=0 |
Set certificate/key cert_type from the cert_enc encoded memory at buffer of size bytes. More... | |
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 (OAuthBearerTokenRefreshCb *&oauthbearer_token_refresh_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 Conf::ConfResult | get (SslCertificateVerifyCb *&ssl_cert_verify_cb) const =0 |
Use with name = "ssl_cert_verify_cb" . | |
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" . | |
virtual struct rd_kafka_conf_s * | c_ptr_global ()=0 |
Returns the underlying librdkafka C rd_kafka_conf_t handle. More... | |
virtual struct rd_kafka_topic_conf_s * | c_ptr_topic ()=0 |
Returns the underlying librdkafka C rd_kafka_topic_conf_t handle. More... | |
virtual Conf::ConfResult | set_engine_callback_data (void *value, std::string &errstr)=0 |
Set callback_data for ssl engine. More... | |
virtual Conf::ConfResult | enable_sasl_queue (bool enable, std::string &errstr)=0 |
Enable/disable creation of a queue specific to SASL events and callbacks. More... | |
Static Public Member Functions | |
static Conf * | create (ConfType type) |
Create configuration object. | |
Configuration interface.
Holds either global or topic configuration that are passed to RdKafka::Consumer::create(), RdKafka::Producer::create(), RdKafka::KafkaConsumer::create(), etc.
Configuration object type.
Enumerator | |
---|---|
CONF_GLOBAL | Global configuration |
CONF_TOPIC | Topic specific configuration |
|
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.
errstr
on error.
|
pure virtual |
Use with name
= "default_topic_conf"
.
Sets the default topic configuration to use for for automatically subscribed topics.
|
pure virtual |
Use with name
= "ssl_cert_verify_cb"
.
|
pure virtual |
Set certificate/key cert_type
from the cert_enc
encoded memory at buffer
of size
bytes.
cert_type | Certificate or key type to configure. |
cert_enc | Buffer encoding type. |
buffer | Memory pointer to encoded certificate or key. The memory is not referenced after this function returns. |
size | Size of memory at buffer . |
errstr | A human-readable error string will be written to this string on failure. |
buffer
is of incorrect encoding, or if librdkafka was not built with SSL support.cert_type
will replace the previous value.buffer
set to NULL will clear the configuration for cert_type
.ssl.key.password
configuration property prior to calling this function.ssl.key.pem
and ssl.certificate.pem
configuration properties.ssl.ca.pem
configuration property.
|
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.
value
.
|
pure virtual |
Query single configuration value.
dr_cb
.
|
pure virtual |
Query single configuration value.
oauthbearer_token_refresh_cb
.
|
pure virtual |
Query single configuration value.
event_cb
.
|
pure virtual |
Query single configuration value.
partitioner_cb
.
|
pure virtual |
Query single configuration value.
partitioner_kp_cb
.
|
pure virtual |
Query single configuration value.
socket_cb
.
|
pure virtual |
Query single configuration value.
open_cb
.
|
pure virtual |
Query single configuration value.
rebalance_cb
.
|
pure virtual |
Query single configuration value.
offset_commit_cb
.
|
pure virtual |
Returns the underlying librdkafka C rd_kafka_conf_t handle.
rd_kafka_conf_t*
if this is a CONF_GLOBAL object, else NULL.
|
pure virtual |
Returns the underlying librdkafka C rd_kafka_topic_conf_t handle.
rd_kafka_topic_conf_t*
if this is a CONF_TOPIC object, else NULL.
|
pure virtual |
Set callback_data for ssl engine.
ssl.engine.location
configuration must be set for this to have affect.value
must remain valid for the lifetime of the configuration object and any Kafka clients that use it.
|
pure virtual |
Enable/disable creation of a queue specific to SASL events and callbacks.
For SASL mechanisms that trigger callbacks (currently OAUTHBEARER) this configuration API allows an application to get a dedicated queue for the SASL events/callbacks. After enabling the queue with this API the application can retrieve the queue by calling RdKafka::Handle::get_sasl_queue() on the client instance. This queue may then be served directly by the application (RdKafka::Queue::poll()) or forwarded to another queue, such as the background queue.
A convenience function is available to automatically forward the SASL queue to librdkafka's background thread, see RdKafka::Handle::sasl_background_callbacks_enable().
By default (enable
= false) the main queue (as served by RdKafka::Handle::poll(), et.al.) is used for SASL callbacks.