librdkafka
The Apache Kafka C/C++ client library
rdkafkacpp.h File Reference

Apache Kafka C/C++ consumer and producer client library. More...

Go to the source code of this file.

Data Structures

class  RdKafka::Error
 The Error class is used as a return value from APIs to propagate an error. The error consists of an error code which is to be used programatically, an error string for showing to the user, and various error flags that can be used programmatically to decide how to handle the error; e.g., should the operation be retried, was it a fatal error, etc. More...
 
class  RdKafka::DeliveryReportCb
 Delivery Report callback class. More...
 
class  RdKafka::OAuthBearerTokenRefreshCb
 SASL/OAUTHBEARER token refresh callback class. More...
 
class  RdKafka::PartitionerCb
 Partitioner callback class. More...
 
class  RdKafka::PartitionerKeyPointerCb
 Variant partitioner with key pointer. More...
 
class  RdKafka::EventCb
 Event callback class. More...
 
class  RdKafka::Event
 Event object class as passed to the EventCb callback. More...
 
class  RdKafka::ConsumeCb
 Consume callback class. More...
 
class  RdKafka::RebalanceCb
 KafkaConsumer: Rebalance callback class More...
 
class  RdKafka::OffsetCommitCb
 Offset Commit callback class. More...
 
class  RdKafka::SslCertificateVerifyCb
 SSL broker certificate verification class. More...
 
class  RdKafka::SocketCb
 Portability: SocketCb callback class More...
 
class  RdKafka::OpenCb
 Portability: OpenCb callback class More...
 
class  RdKafka::Conf
 Configuration interface. More...
 
class  RdKafka::Handle
 Base handle, super class for specific clients. More...
 
class  RdKafka::TopicPartition
 Topic+Partition. More...
 
class  RdKafka::Topic
 Topic handle. More...
 
class  RdKafka::MessageTimestamp
 Message timestamp object. More...
 
class  RdKafka::Headers
 Headers object. More...
 
class  RdKafka::Headers::Header
 Header object. More...
 
class  RdKafka::Message
 Message object. More...
 
class  RdKafka::Queue
 Queue interface. More...
 
class  RdKafka::ConsumerGroupMetadata
 ConsumerGroupMetadata holds a consumer instance's group metadata state. More...
 
class  RdKafka::KafkaConsumer
 High-level KafkaConsumer (for brokers 0.9 and later) More...
 
class  RdKafka::Consumer
 Simple Consumer (legacy) More...
 
class  RdKafka::Producer
 Producer. More...
 
class  RdKafka::BrokerMetadata
 Metadata: Broker information. More...
 
class  RdKafka::PartitionMetadata
 Metadata: Partition information. More...
 
class  RdKafka::TopicMetadata
 Metadata: Topic information. More...
 
class  RdKafka::Metadata
 Metadata container. More...
 

Macros

#define ERR_GROUP_LOAD_IN_PROGRESS   ERR_COORDINATOR_LOAD_IN_PROGRESS
 
#define ERR_GROUP_COORDINATOR_NOT_AVAILABLE   ERR_COORDINATOR_NOT_AVAILABLE
 
#define ERR_NOT_COORDINATOR_FOR_GROUP   ERR_NOT_COORDINATOR
 

Miscellaneous APIs

#define RD_KAFKA_VERSION   0x010900ff
 librdkafka version More...
 
RD_EXPORT int RdKafka::version ()
 Returns the librdkafka version as integer. More...
 
RD_EXPORT std::string RdKafka::version_str ()
 Returns the librdkafka version as string.
 
RD_EXPORT std::string RdKafka::get_debug_contexts ()
 Returns a CSV list of the supported debug contexts for use with Conf::Set("debug", ..).
 
RD_EXPORT int RdKafka::wait_destroyed (int timeout_ms)
 Wait for all rd_kafka_t objects to be destroyed. More...
 
RD_EXPORT void * RdKafka::mem_malloc (size_t size)
 Allocate memory using the same allocator librdkafka uses. More...
 
RD_EXPORT void RdKafka::mem_free (void *ptr)
 Free pointer returned by librdkafka. More...
 

Constants, errors, types

enum  RdKafka::ErrorCode {
  RdKafka::ERR__BEGIN = -200 ,
  RdKafka::ERR__BAD_MSG = -199 ,
  RdKafka::ERR__BAD_COMPRESSION = -198 ,
  RdKafka::ERR__DESTROY = -197 ,
  RdKafka::ERR__FAIL = -196 ,
  RdKafka::ERR__TRANSPORT = -195 ,
  RdKafka::ERR__CRIT_SYS_RESOURCE = -194 ,
  RdKafka::ERR__RESOLVE = -193 ,
  RdKafka::ERR__MSG_TIMED_OUT = -192 ,
  RdKafka::ERR__PARTITION_EOF = -191 ,
  RdKafka::ERR__UNKNOWN_PARTITION = -190 ,
  RdKafka::ERR__FS = -189 ,
  RdKafka::ERR__UNKNOWN_TOPIC = -188 ,
  RdKafka::ERR__ALL_BROKERS_DOWN = -187 ,
  RdKafka::ERR__INVALID_ARG = -186 ,
  RdKafka::ERR__TIMED_OUT = -185 ,
  RdKafka::ERR__QUEUE_FULL = -184 ,
  RdKafka::ERR__ISR_INSUFF = -183 ,
  RdKafka::ERR__NODE_UPDATE = -182 ,
  RdKafka::ERR__SSL = -181 ,
  RdKafka::ERR__WAIT_COORD = -180 ,
  RdKafka::ERR__UNKNOWN_GROUP = -179 ,
  RdKafka::ERR__IN_PROGRESS = -178 ,
  RdKafka::ERR__PREV_IN_PROGRESS = -177 ,
  RdKafka::ERR__EXISTING_SUBSCRIPTION = -176 ,
  RdKafka::ERR__ASSIGN_PARTITIONS = -175 ,
  RdKafka::ERR__REVOKE_PARTITIONS = -174 ,
  RdKafka::ERR__CONFLICT = -173 ,
  RdKafka::ERR__STATE = -172 ,
  RdKafka::ERR__UNKNOWN_PROTOCOL = -171 ,
  RdKafka::ERR__NOT_IMPLEMENTED = -170 ,
  RdKafka::ERR__AUTHENTICATION = -169 ,
  RdKafka::ERR__NO_OFFSET = -168 ,
  RdKafka::ERR__OUTDATED = -167 ,
  RdKafka::ERR__TIMED_OUT_QUEUE = -166 ,
  RdKafka::ERR__UNSUPPORTED_FEATURE = -165 ,
  RdKafka::ERR__WAIT_CACHE = -164 ,
  RdKafka::ERR__INTR = -163 ,
  RdKafka::ERR__KEY_SERIALIZATION = -162 ,
  RdKafka::ERR__VALUE_SERIALIZATION = -161 ,
  RdKafka::ERR__KEY_DESERIALIZATION = -160 ,
  RdKafka::ERR__VALUE_DESERIALIZATION = -159 ,
  RdKafka::ERR__PARTIAL = -158 ,
  RdKafka::ERR__READ_ONLY = -157 ,
  RdKafka::ERR__NOENT = -156 ,
  RdKafka::ERR__UNDERFLOW = -155 ,
  RdKafka::ERR__INVALID_TYPE = -154 ,
  RdKafka::ERR__RETRY = -153 ,
  RdKafka::ERR__PURGE_QUEUE = -152 ,
  RdKafka::ERR__PURGE_INFLIGHT = -151 ,
  RdKafka::ERR__FATAL = -150 ,
  RdKafka::ERR__INCONSISTENT = -149 ,
  RdKafka::ERR__GAPLESS_GUARANTEE = -148 ,
  RdKafka::ERR__MAX_POLL_EXCEEDED = -147 ,
  RdKafka::ERR__UNKNOWN_BROKER = -146 ,
  RdKafka::ERR__NOT_CONFIGURED = -145 ,
  RdKafka::ERR__FENCED = -144 ,
  RdKafka::ERR__APPLICATION = -143 ,
  RdKafka::ERR__ASSIGNMENT_LOST = -142 ,
  RdKafka::ERR__NOOP = -141 ,
  RdKafka::ERR__AUTO_OFFSET_RESET = -140 ,
  RdKafka::ERR__END = -100 ,
  RdKafka::ERR_UNKNOWN = -1 ,
  RdKafka::ERR_NO_ERROR = 0 ,
  RdKafka::ERR_OFFSET_OUT_OF_RANGE = 1 ,
  RdKafka::ERR_INVALID_MSG = 2 ,
  RdKafka::ERR_UNKNOWN_TOPIC_OR_PART = 3 ,
  RdKafka::ERR_INVALID_MSG_SIZE = 4 ,
  RdKafka::ERR_LEADER_NOT_AVAILABLE = 5 ,
  RdKafka::ERR_NOT_LEADER_FOR_PARTITION = 6 ,
  RdKafka::ERR_REQUEST_TIMED_OUT = 7 ,
  RdKafka::ERR_BROKER_NOT_AVAILABLE = 8 ,
  RdKafka::ERR_REPLICA_NOT_AVAILABLE = 9 ,
  RdKafka::ERR_MSG_SIZE_TOO_LARGE = 10 ,
  RdKafka::ERR_STALE_CTRL_EPOCH = 11 ,
  RdKafka::ERR_OFFSET_METADATA_TOO_LARGE = 12 ,
  RdKafka::ERR_NETWORK_EXCEPTION = 13 ,
  RdKafka::ERR_COORDINATOR_LOAD_IN_PROGRESS = 14 ,
  RdKafka::ERR_COORDINATOR_NOT_AVAILABLE = 15 ,
  RdKafka::ERR_NOT_COORDINATOR = 16 ,
  RdKafka::ERR_TOPIC_EXCEPTION = 17 ,
  RdKafka::ERR_RECORD_LIST_TOO_LARGE = 18 ,
  RdKafka::ERR_NOT_ENOUGH_REPLICAS = 19 ,
  RdKafka::ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND = 20 ,
  RdKafka::ERR_INVALID_REQUIRED_ACKS = 21 ,
  RdKafka::ERR_ILLEGAL_GENERATION = 22 ,
  RdKafka::ERR_INCONSISTENT_GROUP_PROTOCOL = 23 ,
  RdKafka::ERR_INVALID_GROUP_ID = 24 ,
  RdKafka::ERR_UNKNOWN_MEMBER_ID = 25 ,
  RdKafka::ERR_INVALID_SESSION_TIMEOUT = 26 ,
  RdKafka::ERR_REBALANCE_IN_PROGRESS = 27 ,
  RdKafka::ERR_INVALID_COMMIT_OFFSET_SIZE = 28 ,
  RdKafka::ERR_TOPIC_AUTHORIZATION_FAILED = 29 ,
  RdKafka::ERR_GROUP_AUTHORIZATION_FAILED = 30 ,
  RdKafka::ERR_CLUSTER_AUTHORIZATION_FAILED = 31 ,
  RdKafka::ERR_INVALID_TIMESTAMP = 32 ,
  RdKafka::ERR_UNSUPPORTED_SASL_MECHANISM = 33 ,
  RdKafka::ERR_ILLEGAL_SASL_STATE = 34 ,
  RdKafka::ERR_UNSUPPORTED_VERSION = 35 ,
  RdKafka::ERR_TOPIC_ALREADY_EXISTS = 36 ,
  RdKafka::ERR_INVALID_PARTITIONS = 37 ,
  RdKafka::ERR_INVALID_REPLICATION_FACTOR = 38 ,
  RdKafka::ERR_INVALID_REPLICA_ASSIGNMENT = 39 ,
  RdKafka::ERR_INVALID_CONFIG = 40 ,
  RdKafka::ERR_NOT_CONTROLLER = 41 ,
  RdKafka::ERR_INVALID_REQUEST = 42 ,
  RdKafka::ERR_UNSUPPORTED_FOR_MESSAGE_FORMAT = 43 ,
  RdKafka::ERR_POLICY_VIOLATION = 44 ,
  RdKafka::ERR_OUT_OF_ORDER_SEQUENCE_NUMBER = 45 ,
  RdKafka::ERR_DUPLICATE_SEQUENCE_NUMBER = 46 ,
  RdKafka::ERR_INVALID_PRODUCER_EPOCH = 47 ,
  RdKafka::ERR_INVALID_TXN_STATE = 48 ,
  RdKafka::ERR_INVALID_PRODUCER_ID_MAPPING = 49 ,
  RdKafka::ERR_INVALID_TRANSACTION_TIMEOUT = 50 ,
  RdKafka::ERR_CONCURRENT_TRANSACTIONS = 51 ,
  RdKafka::ERR_TRANSACTION_COORDINATOR_FENCED = 52 ,
  RdKafka::ERR_TRANSACTIONAL_ID_AUTHORIZATION_FAILED = 53 ,
  RdKafka::ERR_SECURITY_DISABLED = 54 ,
  RdKafka::ERR_OPERATION_NOT_ATTEMPTED = 55 ,
  RdKafka::ERR_KAFKA_STORAGE_ERROR = 56 ,
  RdKafka::ERR_LOG_DIR_NOT_FOUND = 57 ,
  RdKafka::ERR_SASL_AUTHENTICATION_FAILED = 58 ,
  RdKafka::ERR_UNKNOWN_PRODUCER_ID = 59 ,
  RdKafka::ERR_REASSIGNMENT_IN_PROGRESS = 60 ,
  RdKafka::ERR_DELEGATION_TOKEN_AUTH_DISABLED = 61 ,
  RdKafka::ERR_DELEGATION_TOKEN_NOT_FOUND = 62 ,
  RdKafka::ERR_DELEGATION_TOKEN_OWNER_MISMATCH = 63 ,
  RdKafka::ERR_DELEGATION_TOKEN_REQUEST_NOT_ALLOWED = 64 ,
  RdKafka::ERR_DELEGATION_TOKEN_AUTHORIZATION_FAILED = 65 ,
  RdKafka::ERR_DELEGATION_TOKEN_EXPIRED = 66 ,
  RdKafka::ERR_INVALID_PRINCIPAL_TYPE = 67 ,
  RdKafka::ERR_NON_EMPTY_GROUP = 68 ,
  RdKafka::ERR_GROUP_ID_NOT_FOUND = 69 ,
  RdKafka::ERR_FETCH_SESSION_ID_NOT_FOUND = 70 ,
  RdKafka::ERR_INVALID_FETCH_SESSION_EPOCH = 71 ,
  RdKafka::ERR_LISTENER_NOT_FOUND = 72 ,
  RdKafka::ERR_TOPIC_DELETION_DISABLED = 73 ,
  RdKafka::ERR_FENCED_LEADER_EPOCH = 74 ,
  RdKafka::ERR_UNKNOWN_LEADER_EPOCH = 75 ,
  RdKafka::ERR_UNSUPPORTED_COMPRESSION_TYPE = 76 ,
  RdKafka::ERR_STALE_BROKER_EPOCH = 77 ,
  RdKafka::ERR_OFFSET_NOT_AVAILABLE = 78 ,
  RdKafka::ERR_MEMBER_ID_REQUIRED = 79 ,
  RdKafka::ERR_PREFERRED_LEADER_NOT_AVAILABLE = 80 ,
  RdKafka::ERR_GROUP_MAX_SIZE_REACHED = 81 ,
  RdKafka::ERR_FENCED_INSTANCE_ID = 82 ,
  RdKafka::ERR_ELIGIBLE_LEADERS_NOT_AVAILABLE = 83 ,
  RdKafka::ERR_ELECTION_NOT_NEEDED = 84 ,
  RdKafka::ERR_NO_REASSIGNMENT_IN_PROGRESS = 85 ,
  RdKafka::ERR_GROUP_SUBSCRIBED_TO_TOPIC = 86 ,
  RdKafka::ERR_INVALID_RECORD = 87 ,
  RdKafka::ERR_UNSTABLE_OFFSET_COMMIT = 88 ,
  RdKafka::ERR_THROTTLING_QUOTA_EXCEEDED = 89 ,
  RdKafka::ERR_PRODUCER_FENCED = 90 ,
  RdKafka::ERR_RESOURCE_NOT_FOUND = 91 ,
  RdKafka::ERR_DUPLICATE_RESOURCE = 92 ,
  RdKafka::ERR_UNACCEPTABLE_CREDENTIAL = 93 ,
  RdKafka::ERR_INCONSISTENT_VOTER_SET = 94 ,
  RdKafka::ERR_INVALID_UPDATE_VERSION = 95 ,
  RdKafka::ERR_FEATURE_UPDATE_FAILED = 96 ,
  RdKafka::ERR_PRINCIPAL_DESERIALIZATION_FAILURE = 97
}
 Error codes. More...
 
enum  RdKafka::CertificateType {
  RdKafka::CERT_PUBLIC_KEY ,
  RdKafka::CERT_PRIVATE_KEY ,
  RdKafka::CERT_CA ,
  CERT__CNT
}
 SSL certificate types. More...
 
enum  RdKafka::CertificateEncoding {
  RdKafka::CERT_ENC_PKCS12 ,
  RdKafka::CERT_ENC_DER ,
  RdKafka::CERT_ENC_PEM ,
  CERT_ENC__CNT
}
 SSL certificate encoding. More...
 
RD_EXPORT std::string RdKafka::err2str (RdKafka::ErrorCode err)
 Returns a human readable representation of a kafka error.
 

Detailed Description

Apache Kafka C/C++ consumer and producer client library.

rdkafkacpp.h contains the public C++ API for librdkafka. The API is documented in this file as comments prefixing the class, function, type, enum, define, etc. For more information, see the C interface in rdkafka.h and read the manual in INTRODUCTION.md. The C++ interface is STD C++ '03 compliant and adheres to the Google C++ Style Guide.

See also
For the C interface see rdkafka.h

Macro Definition Documentation

◆ RD_KAFKA_VERSION

#define RD_KAFKA_VERSION   0x010900ff

librdkafka version

Interpreted as hex MM.mm.rr.xx:

  • MM = Major
  • mm = minor
  • rr = revision
  • xx = pre-release id (0xff is the final release)

E.g.: 0x000801ff = 0.8.1

Remarks
This value should only be used during compile time, for runtime checks of version use RdKafka::version()

◆ ERR_GROUP_LOAD_IN_PROGRESS

#define ERR_GROUP_LOAD_IN_PROGRESS   ERR_COORDINATOR_LOAD_IN_PROGRESS

Group coordinator load in progress

◆ ERR_GROUP_COORDINATOR_NOT_AVAILABLE

#define ERR_GROUP_COORDINATOR_NOT_AVAILABLE   ERR_COORDINATOR_NOT_AVAILABLE

Group coordinator not available

◆ ERR_NOT_COORDINATOR_FOR_GROUP

#define ERR_NOT_COORDINATOR_FOR_GROUP   ERR_NOT_COORDINATOR

Not coordinator for group

Enumeration Type Documentation

◆ ErrorCode

Error codes.

The negative error codes delimited by two underscores (_ERR__..) denotes errors internal to librdkafka and are displayed as "Local: <error string..>", while the error codes delimited by a single underscore (ERR_..) denote broker errors and are displayed as "Broker: <error string..>".

See also
Use RdKafka::err2str() to translate an error code a human readable string
Enumerator
ERR__BEGIN 

Begin internal error codes

ERR__BAD_MSG 

Received message is incorrect

ERR__BAD_COMPRESSION 

Bad/unknown compression

ERR__DESTROY 

Broker is going away

ERR__FAIL 

Generic failure

ERR__TRANSPORT 

Broker transport failure

ERR__CRIT_SYS_RESOURCE 

Critical system resource

ERR__RESOLVE 

Failed to resolve broker

ERR__MSG_TIMED_OUT 

Produced message timed out

ERR__PARTITION_EOF 

Reached the end of the topic+partition queue on the broker. Not really an error. This event is disabled by default, see the enable.partition.eof configuration property.

ERR__UNKNOWN_PARTITION 

Permanent: Partition does not exist in cluster.

ERR__FS 

File or filesystem error

ERR__UNKNOWN_TOPIC 

Permanent: Topic does not exist in cluster.

ERR__ALL_BROKERS_DOWN 

All broker connections are down.

ERR__INVALID_ARG 

Invalid argument, or invalid configuration

ERR__TIMED_OUT 

Operation timed out

ERR__QUEUE_FULL 

Queue is full

ERR__ISR_INSUFF 

ISR count < required.acks

ERR__NODE_UPDATE 

Broker node update

ERR__SSL 

SSL error

ERR__WAIT_COORD 

Waiting for coordinator to become available.

ERR__UNKNOWN_GROUP 

Unknown client group

ERR__IN_PROGRESS 

Operation in progress

ERR__PREV_IN_PROGRESS 

Previous operation in progress, wait for it to finish.

ERR__EXISTING_SUBSCRIPTION 

This operation would interfere with an existing subscription

ERR__ASSIGN_PARTITIONS 

Assigned partitions (rebalance_cb)

ERR__REVOKE_PARTITIONS 

Revoked partitions (rebalance_cb)

ERR__CONFLICT 

Conflicting use

ERR__STATE 

Wrong state

ERR__UNKNOWN_PROTOCOL 

Unknown protocol

ERR__NOT_IMPLEMENTED 

Not implemented

ERR__AUTHENTICATION 

Authentication failure

ERR__NO_OFFSET 

No stored offset

ERR__OUTDATED 

Outdated

ERR__TIMED_OUT_QUEUE 

Timed out in queue

ERR__UNSUPPORTED_FEATURE 

Feature not supported by broker

ERR__WAIT_CACHE 

Awaiting cache update

ERR__INTR 

Operation interrupted

ERR__KEY_SERIALIZATION 

Key serialization error

ERR__VALUE_SERIALIZATION 

Value serialization error

ERR__KEY_DESERIALIZATION 

Key deserialization error

ERR__VALUE_DESERIALIZATION 

Value deserialization error

ERR__PARTIAL 

Partial response

ERR__READ_ONLY 

Modification attempted on read-only object

ERR__NOENT 

No such entry / item not found

ERR__UNDERFLOW 

Read underflow

ERR__INVALID_TYPE 

Invalid type

ERR__RETRY 

Retry operation

ERR__PURGE_QUEUE 

Purged in queue

ERR__PURGE_INFLIGHT 

Purged in flight

ERR__FATAL 

Fatal error: see RdKafka::Handle::fatal_error()

ERR__INCONSISTENT 

Inconsistent state

ERR__GAPLESS_GUARANTEE 

Gap-less ordering would not be guaranteed if proceeding

ERR__MAX_POLL_EXCEEDED 

Maximum poll interval exceeded

ERR__UNKNOWN_BROKER 

Unknown broker

ERR__NOT_CONFIGURED 

Functionality not configured

ERR__FENCED 

Instance has been fenced

ERR__APPLICATION 

Application generated error

ERR__ASSIGNMENT_LOST 

Assignment lost

ERR__NOOP 

No operation performed

ERR__AUTO_OFFSET_RESET 

No offset to automatically reset to

ERR__END 

End internal error codes

ERR_UNKNOWN 

Unknown broker error

ERR_NO_ERROR 

Success

ERR_OFFSET_OUT_OF_RANGE 

Offset out of range

ERR_INVALID_MSG 

Invalid message

ERR_UNKNOWN_TOPIC_OR_PART 

Unknown topic or partition

ERR_INVALID_MSG_SIZE 

Invalid message size

ERR_LEADER_NOT_AVAILABLE 

Leader not available

ERR_NOT_LEADER_FOR_PARTITION 

Not leader for partition

ERR_REQUEST_TIMED_OUT 

Request timed out

ERR_BROKER_NOT_AVAILABLE 

Broker not available

ERR_REPLICA_NOT_AVAILABLE 

Replica not available

ERR_MSG_SIZE_TOO_LARGE 

Message size too large

ERR_STALE_CTRL_EPOCH 

StaleControllerEpochCode

ERR_OFFSET_METADATA_TOO_LARGE 

Offset metadata string too large

ERR_NETWORK_EXCEPTION 

Broker disconnected before response received

ERR_COORDINATOR_LOAD_IN_PROGRESS 

Coordinator load in progress

ERR_COORDINATOR_NOT_AVAILABLE 

Coordinator not available

ERR_NOT_COORDINATOR 

Not coordinator

ERR_TOPIC_EXCEPTION 

Invalid topic

ERR_RECORD_LIST_TOO_LARGE 

Message batch larger than configured server segment size

ERR_NOT_ENOUGH_REPLICAS 

Not enough in-sync replicas

ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND 

Message(s) written to insufficient number of in-sync replicas

ERR_INVALID_REQUIRED_ACKS 

Invalid required acks value

ERR_ILLEGAL_GENERATION 

Specified group generation id is not valid

ERR_INCONSISTENT_GROUP_PROTOCOL 

Inconsistent group protocol

ERR_INVALID_GROUP_ID 

Invalid group.id

ERR_UNKNOWN_MEMBER_ID 

Unknown member

ERR_INVALID_SESSION_TIMEOUT 

Invalid session timeout

ERR_REBALANCE_IN_PROGRESS 

Group rebalance in progress

ERR_INVALID_COMMIT_OFFSET_SIZE 

Commit offset data size is not valid

ERR_TOPIC_AUTHORIZATION_FAILED 

Topic authorization failed

ERR_GROUP_AUTHORIZATION_FAILED 

Group authorization failed

ERR_CLUSTER_AUTHORIZATION_FAILED 

Cluster authorization failed

ERR_INVALID_TIMESTAMP 

Invalid timestamp

ERR_UNSUPPORTED_SASL_MECHANISM 

Unsupported SASL mechanism

ERR_ILLEGAL_SASL_STATE 

Illegal SASL state

ERR_UNSUPPORTED_VERSION 

Unuspported version

ERR_TOPIC_ALREADY_EXISTS 

Topic already exists

ERR_INVALID_PARTITIONS 

Invalid number of partitions

ERR_INVALID_REPLICATION_FACTOR 

Invalid replication factor

ERR_INVALID_REPLICA_ASSIGNMENT 

Invalid replica assignment

ERR_INVALID_CONFIG 

Invalid config

ERR_NOT_CONTROLLER 

Not controller for cluster

ERR_INVALID_REQUEST 

Invalid request

ERR_UNSUPPORTED_FOR_MESSAGE_FORMAT 

Message format on broker does not support request

ERR_POLICY_VIOLATION 

Policy violation

ERR_OUT_OF_ORDER_SEQUENCE_NUMBER 

Broker received an out of order sequence number

ERR_DUPLICATE_SEQUENCE_NUMBER 

Broker received a duplicate sequence number

ERR_INVALID_PRODUCER_EPOCH 

Producer attempted an operation with an old epoch

ERR_INVALID_TXN_STATE 

Producer attempted a transactional operation in an invalid state

ERR_INVALID_PRODUCER_ID_MAPPING 

Producer attempted to use a producer id which is not currently assigned to its transactional id

ERR_INVALID_TRANSACTION_TIMEOUT 

Transaction timeout is larger than the maximum value allowed by the broker's max.transaction.timeout.ms

ERR_CONCURRENT_TRANSACTIONS 

Producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing

ERR_TRANSACTION_COORDINATOR_FENCED 

Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer

ERR_TRANSACTIONAL_ID_AUTHORIZATION_FAILED 

Transactional Id authorization failed

ERR_SECURITY_DISABLED 

Security features are disabled

ERR_OPERATION_NOT_ATTEMPTED 

Operation not attempted

ERR_KAFKA_STORAGE_ERROR 

Disk error when trying to access log file on the disk

ERR_LOG_DIR_NOT_FOUND 

The user-specified log directory is not found in the broker config

ERR_SASL_AUTHENTICATION_FAILED 

SASL Authentication failed

ERR_UNKNOWN_PRODUCER_ID 

Unknown Producer Id

ERR_REASSIGNMENT_IN_PROGRESS 

Partition reassignment is in progress

ERR_DELEGATION_TOKEN_AUTH_DISABLED 

Delegation Token feature is not enabled

ERR_DELEGATION_TOKEN_NOT_FOUND 

Delegation Token is not found on server

ERR_DELEGATION_TOKEN_OWNER_MISMATCH 

Specified Principal is not valid Owner/Renewer

ERR_DELEGATION_TOKEN_REQUEST_NOT_ALLOWED 

Delegation Token requests are not allowed on this connection

ERR_DELEGATION_TOKEN_AUTHORIZATION_FAILED 

Delegation Token authorization failed

ERR_DELEGATION_TOKEN_EXPIRED 

Delegation Token is expired

ERR_INVALID_PRINCIPAL_TYPE 

Supplied principalType is not supported

ERR_NON_EMPTY_GROUP 

The group is not empty

ERR_GROUP_ID_NOT_FOUND 

The group id does not exist

ERR_FETCH_SESSION_ID_NOT_FOUND 

The fetch session ID was not found

ERR_INVALID_FETCH_SESSION_EPOCH 

The fetch session epoch is invalid

ERR_LISTENER_NOT_FOUND 

No matching listener

ERR_TOPIC_DELETION_DISABLED 

Topic deletion is disabled

ERR_FENCED_LEADER_EPOCH 

Leader epoch is older than broker epoch

ERR_UNKNOWN_LEADER_EPOCH 

Leader epoch is newer than broker epoch

ERR_UNSUPPORTED_COMPRESSION_TYPE 

Unsupported compression type

ERR_STALE_BROKER_EPOCH 

Broker epoch has changed

ERR_OFFSET_NOT_AVAILABLE 

Leader high watermark is not caught up

ERR_MEMBER_ID_REQUIRED 

Group member needs a valid member ID

ERR_PREFERRED_LEADER_NOT_AVAILABLE 

Preferred leader was not available

ERR_GROUP_MAX_SIZE_REACHED 

Consumer group has reached maximum size

ERR_FENCED_INSTANCE_ID 

Static consumer fenced by other consumer with same group.instance.id.

ERR_ELIGIBLE_LEADERS_NOT_AVAILABLE 

Eligible partition leaders are not available

ERR_ELECTION_NOT_NEEDED 

Leader election not needed for topic partition

ERR_NO_REASSIGNMENT_IN_PROGRESS 

No partition reassignment is in progress

ERR_GROUP_SUBSCRIBED_TO_TOPIC 

Deleting offsets of a topic while the consumer group is subscribed to it

ERR_INVALID_RECORD 

Broker failed to validate record

ERR_UNSTABLE_OFFSET_COMMIT 

There are unstable offsets that need to be cleared

ERR_THROTTLING_QUOTA_EXCEEDED 

Throttling quota has been exceeded

ERR_PRODUCER_FENCED 

There is a newer producer with the same transactionalId which fences the current one

ERR_RESOURCE_NOT_FOUND 

Request illegally referred to resource that does not exist

ERR_DUPLICATE_RESOURCE 

Request illegally referred to the same resource twice

ERR_UNACCEPTABLE_CREDENTIAL 

Requested credential would not meet criteria for acceptability

ERR_INCONSISTENT_VOTER_SET 

Indicates that the either the sender or recipient of a voter-only request is not one of the expected voters

ERR_INVALID_UPDATE_VERSION 

Invalid update version

ERR_FEATURE_UPDATE_FAILED 

Unable to update finalized features due to server error

ERR_PRINCIPAL_DESERIALIZATION_FAILURE 

Request principal deserialization failed during forwarding

◆ CertificateType

SSL certificate types.

Enumerator
CERT_PUBLIC_KEY 

Client's public key

CERT_PRIVATE_KEY 

Client's private key

CERT_CA 

CA certificate

◆ CertificateEncoding

SSL certificate encoding.

Enumerator
CERT_ENC_PKCS12 

PKCS#12

CERT_ENC_DER 

DER / binary X.509 ASN1

CERT_ENC_PEM 

PEM

Function Documentation

◆ version()

RD_EXPORT int RdKafka::version ( )

Returns the librdkafka version as integer.

See also
See RD_KAFKA_VERSION for how to parse the integer format.

◆ wait_destroyed()

RD_EXPORT int RdKafka::wait_destroyed ( int  timeout_ms)

Wait for all rd_kafka_t objects to be destroyed.

Returns
0 if all kafka objects are now destroyed, or -1 if the timeout was reached. Since RdKafka handle deletion is an asynch operation the wait_destroyed() function can be used for applications where a clean shutdown is required.

◆ mem_malloc()

RD_EXPORT void* RdKafka::mem_malloc ( size_t  size)

Allocate memory using the same allocator librdkafka uses.

This is typically an abstraction for the malloc(3) call and makes sure the application can use the same memory allocator as librdkafka for allocating pointers that are used by librdkafka.

Remarks
Memory allocated by mem_malloc() must be freed using mem_free().

◆ mem_free()

RD_EXPORT void RdKafka::mem_free ( void *  ptr)

Free pointer returned by librdkafka.

This is typically an abstraction for the free(3) call and makes sure the application can use the same memory allocator as librdkafka for freeing pointers returned by librdkafka.

In standard setups it is usually not necessary to use this interface rather than the free(3) function.

Remarks
mem_free() must only be used for pointers returned by APIs that explicitly mention using this function for freeing.