Modern C++ Kafka API
Public Member Functions | Static Public Attributes | List of all members
KAFKA_API::clients::consumer::ConsumerConfig Class Reference

Configuration for the Kafka Consumer. More...

#include <ConsumerConfig.h>

Inheritance diagram for KAFKA_API::clients::consumer::ConsumerConfig:
KAFKA_API::clients::Config KAFKA_API::Properties

Public Member Functions

 ConsumerConfig (const ConsumerConfig &)=default
 
 ConsumerConfig (const PropertiesMap &kvMap)
 
- Public Member Functions inherited from KAFKA_API::clients::Config
 Config (const Config &)=default
 
 Config (const PropertiesMap &kvMap)
 
- Public Member Functions inherited from KAFKA_API::Properties
 Properties (const Properties &)=default
 
 Properties (PropertiesMap kvMap)
 
bool operator== (const Properties &rhs) const
 
template<class T >
Propertiesput (const std::string &key, const T &value)
 Set a property. More...
 
void remove (const std::string &key)
 Remove the property (if one exists).
 
bool contains (const std::string &key) const
 Check whether the map contains a property.
 
template<class T >
T & get (const std::string &key) const
 Get a property reference. More...
 
Optional< std::string > getProperty (const std::string &key) const
 Get a property.
 
void eraseProperty (const std::string &key)
 Remove a property.
 
std::string toString () const
 
const PropertiesMap & map () const
 Get all properties with a map.
 

Static Public Attributes

static constexpr const char * GROUP_ID = "group.id"
 Group identifier. More...
 
static constexpr const char * ENABLE_AUTO_COMMIT = "enable.auto.commit"
 Automatically commits previously polled offsets on each poll operation.
 
static constexpr const char * AUTO_OFFSET_RESET = "auto.offset.reset"
 This property controls the behavior of the consumer when it starts reading a partition for which it doesn't have a valid committed offset. More...
 
static constexpr const char * ENABLE_PARTITION_EOF = "enable.partition.eof"
 Emit RD_KAFKA_RESP_ERR_PARTITION_EOF event whenever the consumer reaches the end of a partition. More...
 
static constexpr const char * MAX_POLL_RECORDS = "max.poll.records"
 This controls the maximum number of records that a single call to poll() will return. More...
 
static constexpr const char * QUEUED_MIN_MESSAGES = "queued.min.messages"
 Minimum number of messages per topic/partition tries to maintain in the local consumer queue. More...
 
static constexpr const char * SESSION_TIMEOUT_MS = "session.timeout.ms"
 Client group session and failure detection timeout. More...
 
static constexpr const char * ISOLATION_LEVEL = "isolation.level"
 Control how to read messages written transactionally. More...
 
static constexpr const char * PARTITION_ASSIGNMENT_STRATEGY = "partition.assignment.strategy"
 
- Static Public Attributes inherited from KAFKA_API::clients::Config
static constexpr const char * ENABLE_MANUAL_EVENTS_POLL = "enable.manual.events.poll"
 To poll the events manually (otherwise, it would be done with a background polling thread). More...
 
static constexpr const char * LOG_CB = "log_cb"
 Log callback. More...
 
static constexpr const char * ERROR_CB = "error_cb"
 Log callback. More...
 
static constexpr const char * STATS_CB = "stats_cb"
 Statistics callback. More...
 
static constexpr const char * OAUTHBEARER_TOKEN_REFRESH_CB = "oauthbearer_token_refresh_cb"
 OAUTHBEARER token refresh callback. More...
 
static constexpr const char * INTERCEPTORS = "interceptors"
 Interceptors for thread start/exit, brokers' state change, etc. More...
 
static constexpr const char * BOOTSTRAP_SERVERS = "bootstrap.servers"
 The string contains host:port pairs of brokers (splitted by ",") that the consumer will use to establish initial connection to the Kafka cluster. More...
 
static constexpr const char * CLIENT_ID = "client.id"
 Client identifier.
 
static constexpr const char * LOG_LEVEL = "log_level"
 Log level (syslog(3) levels).
 
static constexpr const char * SOCKET_TIMEOUT_MS = "socket.timeout.ms"
 Timeout for network requests. More...
 
static constexpr const char * SECURITY_PROTOCOL = "security.protocol"
 Protocol used to communicate with brokers. More...
 
static constexpr const char * SASL_MECHANISM = "sasl.mechanisms"
 SASL mechanism to use for authentication. More...
 
static constexpr const char * SASL_USERNAME = "sasl.username"
 SASL username for use with the PLAIN and SASL-SCRAM-. More...
 
static constexpr const char * SASL_PASSWORD = "sasl.password"
 SASL password for use with the PLAIN and SASL-SCRAM-. More...
 
static constexpr const char * SASL_KERBEROS_KINIT_CMD = "sasl.kerberos.kinit.cmd"
 Shell command to refresh or acquire the client's Kerberos ticket.
 
static constexpr const char * SASL_KERBEROS_SERVICE_NAME = "sasl.kerberos.service.name"
 The client's Kerberos principal name.
 
static constexpr const char * SASL_OAUTHBEARER_METHOD = "sasl.oauthbearer.method"
 Set to "default" or "oidc" to control with login method to be used. More...
 
static constexpr const char * SASL_OAUTHBEARER_CLIENT_ID = "sasl.oauthbearer.client.id"
 Public identifier for the applicaition. More...
 
static constexpr const char * SASL_OAUTHBEARER_CLIENT_SECRET = "sasl.oauthbearer.client.secret"
 Client secret only known to the application and the authorization server. More...
 
static constexpr const char * SASL_OAUTHBEARER_EXTENSIONS = "sasl.oauthbearer.extensions"
 Allow additional information to be provided to the broker. More...
 
static constexpr const char * SASL_OAUTHBEARER_SCOPE = "sasl.oauthbearer.scope"
 Client use this to specify the scope of the access request to the broker. More...
 
static constexpr const char * SASL_OAUTHBEARER_TOKEN_ENDPOINT_URL = "sasl.oauthbearer.token.endpoint.url"
 OAuth/OIDC issuer token endpoint HTTP(S) URI used to retreve token. More...
 
static constexpr const char * SASL_OAUTHBEARER_CONFIG = "sasl.oauthbearer.config"
 SASL/OAUTHBEARER configuration. More...
 
static constexpr const char * ENABLE_SASL_OAUTHBEARER_UNSECURE_JWT = "enable.sasl.oauthbearer.unsecure.jwt"
 Enable the builtin unsecure JWT OAUTHBEARER token handler if no oauthbearer_refresh_cb has been set. More...
 

Additional Inherited Members

- Public Types inherited from KAFKA_API::Properties
using PropertiesMap = std::map< std::string, ValueType >
 

Detailed Description

Configuration for the Kafka Consumer.

Member Data Documentation

◆ AUTO_OFFSET_RESET

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::AUTO_OFFSET_RESET = "auto.offset.reset"
staticconstexpr

This property controls the behavior of the consumer when it starts reading a partition for which it doesn't have a valid committed offset.

The "latest" means the consumer will begin reading the newest records written after the consumer started. While "earliest" means that the consumer will read from the very beginning. Available options: latest, earliest Default value: latest

◆ ENABLE_PARTITION_EOF

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::ENABLE_PARTITION_EOF = "enable.partition.eof"
staticconstexpr

Emit RD_KAFKA_RESP_ERR_PARTITION_EOF event whenever the consumer reaches the end of a partition.

Default value: false

◆ GROUP_ID

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::GROUP_ID = "group.id"
staticconstexpr

Group identifier.

Note: It's better to configure it manually, otherwise a random one would be used for it.

◆ ISOLATION_LEVEL

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::ISOLATION_LEVEL = "isolation.level"
staticconstexpr

Control how to read messages written transactionally.

Available options: read_uncommitted, read_committed Default value: read_committed

◆ MAX_POLL_RECORDS

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::MAX_POLL_RECORDS = "max.poll.records"
staticconstexpr

This controls the maximum number of records that a single call to poll() will return.

Default value: 500

◆ QUEUED_MIN_MESSAGES

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::QUEUED_MIN_MESSAGES = "queued.min.messages"
staticconstexpr

Minimum number of messages per topic/partition tries to maintain in the local consumer queue.

Note: With a larger value configured, the consumer would send FetchRequest towards brokers more frequently. Defalut value: 100000

◆ SESSION_TIMEOUT_MS

constexpr const char* KAFKA_API::clients::consumer::ConsumerConfig::SESSION_TIMEOUT_MS = "session.timeout.ms"
staticconstexpr

Client group session and failure detection timeout.

If no heartbeat received by the broker within this timeout, the broker will remove the consumer and trigger a rebalance. Default value: 10000


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