29 #ifndef _RDKAFKACPP_H_
30 #define _RDKAFKACPP_H_
56 #include <sys/types.h>
63 #ifndef _SSIZE_T_DEFINED
64 #define _SSIZE_T_DEFINED
65 typedef SSIZE_T ssize_t;
69 #ifdef LIBRDKAFKA_STATICLIB
72 #ifdef LIBRDKAFKACPP_EXPORTS
73 #define RD_EXPORT __declspec(dllexport)
75 #define RD_EXPORT __declspec(dllimport)
87 struct rd_kafka_topic_s;
88 struct rd_kafka_message_s;
89 struct rd_kafka_conf_s;
90 struct rd_kafka_topic_conf_s;
114 #define RD_KAFKA_VERSION 0x010502ff
128 std::string version_str();
135 std::string get_debug_contexts();
147 int wait_destroyed(
int timeout_ms);
179 ERR__BAD_COMPRESSION = -198,
185 ERR__TRANSPORT = -195,
187 ERR__CRIT_SYS_RESOURCE = -194,
191 ERR__MSG_TIMED_OUT = -192,
196 ERR__PARTITION_EOF = -191,
198 ERR__UNKNOWN_PARTITION = -190,
202 ERR__UNKNOWN_TOPIC = -188,
204 ERR__ALL_BROKERS_DOWN = -187,
206 ERR__INVALID_ARG = -186,
208 ERR__TIMED_OUT = -185,
210 ERR__QUEUE_FULL = -184,
212 ERR__ISR_INSUFF = -183,
214 ERR__NODE_UPDATE = -182,
218 ERR__WAIT_COORD = -180,
220 ERR__UNKNOWN_GROUP = -179,
222 ERR__IN_PROGRESS = -178,
224 ERR__PREV_IN_PROGRESS = -177,
226 ERR__EXISTING_SUBSCRIPTION = -176,
228 ERR__ASSIGN_PARTITIONS = -175,
230 ERR__REVOKE_PARTITIONS = -174,
232 ERR__CONFLICT = -173,
236 ERR__UNKNOWN_PROTOCOL = -171,
238 ERR__NOT_IMPLEMENTED = -170,
240 ERR__AUTHENTICATION = -169,
242 ERR__NO_OFFSET = -168,
244 ERR__OUTDATED = -167,
246 ERR__TIMED_OUT_QUEUE = -166,
248 ERR__UNSUPPORTED_FEATURE = -165,
250 ERR__WAIT_CACHE = -164,
254 ERR__KEY_SERIALIZATION = -162,
256 ERR__VALUE_SERIALIZATION = -161,
258 ERR__KEY_DESERIALIZATION = -160,
260 ERR__VALUE_DESERIALIZATION = -159,
264 ERR__READ_ONLY = -157,
268 ERR__UNDERFLOW = -155,
270 ERR__INVALID_TYPE = -154,
274 ERR__PURGE_QUEUE = -152,
276 ERR__PURGE_INFLIGHT = -151,
280 ERR__INCONSISTENT = -149,
282 ERR__GAPLESS_GUARANTEE = -148,
284 ERR__MAX_POLL_EXCEEDED = -147,
286 ERR__UNKNOWN_BROKER = -146,
288 ERR__NOT_CONFIGURED = -145,
292 ERR__APPLICATION = -143,
303 ERR_OFFSET_OUT_OF_RANGE = 1,
307 ERR_UNKNOWN_TOPIC_OR_PART = 3,
309 ERR_INVALID_MSG_SIZE = 4,
311 ERR_LEADER_NOT_AVAILABLE = 5,
313 ERR_NOT_LEADER_FOR_PARTITION = 6,
315 ERR_REQUEST_TIMED_OUT = 7,
317 ERR_BROKER_NOT_AVAILABLE = 8,
319 ERR_REPLICA_NOT_AVAILABLE = 9,
321 ERR_MSG_SIZE_TOO_LARGE = 10,
323 ERR_STALE_CTRL_EPOCH = 11,
325 ERR_OFFSET_METADATA_TOO_LARGE = 12,
327 ERR_NETWORK_EXCEPTION = 13,
329 ERR_COORDINATOR_LOAD_IN_PROGRESS = 14,
331 #define ERR_GROUP_LOAD_IN_PROGRESS ERR_COORDINATOR_LOAD_IN_PROGRESS
333 ERR_COORDINATOR_NOT_AVAILABLE = 15,
335 #define ERR_GROUP_COORDINATOR_NOT_AVAILABLE ERR_COORDINATOR_NOT_AVAILABLE
337 ERR_NOT_COORDINATOR = 16,
339 #define ERR_NOT_COORDINATOR_FOR_GROUP ERR_NOT_COORDINATOR
341 ERR_TOPIC_EXCEPTION = 17,
343 ERR_RECORD_LIST_TOO_LARGE = 18,
345 ERR_NOT_ENOUGH_REPLICAS = 19,
347 ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND = 20,
349 ERR_INVALID_REQUIRED_ACKS = 21,
351 ERR_ILLEGAL_GENERATION = 22,
353 ERR_INCONSISTENT_GROUP_PROTOCOL = 23,
355 ERR_INVALID_GROUP_ID = 24,
357 ERR_UNKNOWN_MEMBER_ID = 25,
359 ERR_INVALID_SESSION_TIMEOUT = 26,
361 ERR_REBALANCE_IN_PROGRESS = 27,
363 ERR_INVALID_COMMIT_OFFSET_SIZE = 28,
365 ERR_TOPIC_AUTHORIZATION_FAILED = 29,
367 ERR_GROUP_AUTHORIZATION_FAILED = 30,
369 ERR_CLUSTER_AUTHORIZATION_FAILED = 31,
371 ERR_INVALID_TIMESTAMP = 32,
373 ERR_UNSUPPORTED_SASL_MECHANISM = 33,
375 ERR_ILLEGAL_SASL_STATE = 34,
377 ERR_UNSUPPORTED_VERSION = 35,
379 ERR_TOPIC_ALREADY_EXISTS = 36,
381 ERR_INVALID_PARTITIONS = 37,
383 ERR_INVALID_REPLICATION_FACTOR = 38,
385 ERR_INVALID_REPLICA_ASSIGNMENT = 39,
387 ERR_INVALID_CONFIG = 40,
389 ERR_NOT_CONTROLLER = 41,
391 ERR_INVALID_REQUEST = 42,
393 ERR_UNSUPPORTED_FOR_MESSAGE_FORMAT = 43,
395 ERR_POLICY_VIOLATION = 44,
397 ERR_OUT_OF_ORDER_SEQUENCE_NUMBER = 45,
399 ERR_DUPLICATE_SEQUENCE_NUMBER = 46,
401 ERR_INVALID_PRODUCER_EPOCH = 47,
403 ERR_INVALID_TXN_STATE = 48,
406 ERR_INVALID_PRODUCER_ID_MAPPING = 49,
409 ERR_INVALID_TRANSACTION_TIMEOUT = 50,
412 ERR_CONCURRENT_TRANSACTIONS = 51,
416 ERR_TRANSACTION_COORDINATOR_FENCED = 52,
418 ERR_TRANSACTIONAL_ID_AUTHORIZATION_FAILED = 53,
420 ERR_SECURITY_DISABLED = 54,
422 ERR_OPERATION_NOT_ATTEMPTED = 55,
424 ERR_KAFKA_STORAGE_ERROR = 56,
426 ERR_LOG_DIR_NOT_FOUND = 57,
428 ERR_SASL_AUTHENTICATION_FAILED = 58,
430 ERR_UNKNOWN_PRODUCER_ID = 59,
432 ERR_REASSIGNMENT_IN_PROGRESS = 60,
434 ERR_DELEGATION_TOKEN_AUTH_DISABLED = 61,
436 ERR_DELEGATION_TOKEN_NOT_FOUND = 62,
438 ERR_DELEGATION_TOKEN_OWNER_MISMATCH = 63,
440 ERR_DELEGATION_TOKEN_REQUEST_NOT_ALLOWED = 64,
442 ERR_DELEGATION_TOKEN_AUTHORIZATION_FAILED = 65,
444 ERR_DELEGATION_TOKEN_EXPIRED = 66,
446 ERR_INVALID_PRINCIPAL_TYPE = 67,
448 ERR_NON_EMPTY_GROUP = 68,
450 ERR_GROUP_ID_NOT_FOUND = 69,
452 ERR_FETCH_SESSION_ID_NOT_FOUND = 70,
454 ERR_INVALID_FETCH_SESSION_EPOCH = 71,
456 ERR_LISTENER_NOT_FOUND = 72,
458 ERR_TOPIC_DELETION_DISABLED = 73,
460 ERR_FENCED_LEADER_EPOCH = 74,
462 ERR_UNKNOWN_LEADER_EPOCH = 75,
464 ERR_UNSUPPORTED_COMPRESSION_TYPE = 76,
466 ERR_STALE_BROKER_EPOCH = 77,
468 ERR_OFFSET_NOT_AVAILABLE = 78,
470 ERR_MEMBER_ID_REQUIRED = 79,
472 ERR_PREFERRED_LEADER_NOT_AVAILABLE = 80,
474 ERR_GROUP_MAX_SIZE_REACHED = 81,
477 ERR_FENCED_INSTANCE_ID = 82,
479 ERR_ELIGIBLE_LEADERS_NOT_AVAILABLE = 83,
481 ERR_ELECTION_NOT_NEEDED = 84,
483 ERR_NO_REASSIGNMENT_IN_PROGRESS = 85,
485 ERR_GROUP_SUBSCRIBED_TO_TOPIC = 86,
487 ERR_INVALID_RECORD = 87,
489 ERR_UNSTABLE_OFFSET_COMMIT = 88
497 std::string err2str(RdKafka::ErrorCode err);
505 enum CertificateType {
516 enum CertificateEncoding {
535 class TopicPartition;
563 static Error *create (ErrorCode code,
const std::string *errstr);
565 virtual ~
Error () { }
574 virtual ErrorCode code ()
const = 0;
579 virtual std::string name ()
const = 0;
584 virtual std::string str ()
const = 0;
590 virtual bool is_fatal ()
const = 0;
595 virtual bool is_retriable ()
const = 0;
608 virtual bool txn_requires_abort ()
const = 0;
647 virtual void dr_cb (
Message &message) = 0;
685 virtual void oauthbearer_token_refresh_cb (
const std::string &oauthbearer_config) = 0;
716 virtual int32_t partitioner_cb (
const Topic *topic,
717 const std::string *key,
718 int32_t partition_cnt,
719 void *msg_opaque) = 0;
741 int32_t partition_cnt,
742 void *msg_opaque) = 0;
764 virtual void event_cb (
Event &event) = 0;
785 EVENT_SEVERITY_EMERG = 0,
786 EVENT_SEVERITY_ALERT = 1,
787 EVENT_SEVERITY_CRITICAL = 2,
788 EVENT_SEVERITY_ERROR = 3,
789 EVENT_SEVERITY_WARNING = 4,
790 EVENT_SEVERITY_NOTICE = 5,
791 EVENT_SEVERITY_INFO = 6,
792 EVENT_SEVERITY_DEBUG = 7
795 virtual ~
Event () { }
805 virtual Type type ()
const = 0;
811 virtual ErrorCode err ()
const = 0;
817 virtual Severity severity ()
const = 0;
823 virtual std::string fac ()
const = 0;
833 virtual std::string str ()
const = 0;
839 virtual int throttle_time ()
const = 0;
845 virtual std::string broker_name ()
const = 0;
851 virtual int broker_id ()
const = 0;
859 virtual bool fatal ()
const = 0;
876 virtual void consume_cb (
Message &message,
void *opaque) = 0;
937 RdKafka::ErrorCode err,
938 std::vector<TopicPartition*>&partitions) = 0;
964 virtual void offset_commit_cb(RdKafka::ErrorCode err,
965 std::vector<TopicPartition*>&offsets) = 0;
1015 virtual bool ssl_cert_verify_cb (
const std::string &broker_name,
1019 const char *buf,
size_t size,
1020 std::string &errstr) = 0;
1045 virtual int socket_cb (
int domain,
int type,
int protocol) = 0;
1068 virtual int open_cb (
const std::string &path,
int flags,
int mode) = 0;
1117 static Conf *create (ConfType type);
1119 virtual ~
Conf () { }
1135 const std::string &value,
1136 std::string &errstr) = 0;
1140 DeliveryReportCb *dr_cb,
1141 std::string &errstr) = 0;
1145 OAuthBearerTokenRefreshCb *oauthbearer_token_refresh_cb,
1146 std::string &errstr) = 0;
1151 std::string &errstr) = 0;
1161 const Conf *topic_conf,
1162 std::string &errstr) = 0;
1166 PartitionerCb *partitioner_cb,
1167 std::string &errstr) = 0;
1171 PartitionerKeyPointerCb *partitioner_kp_cb,
1172 std::string &errstr) = 0;
1175 virtual Conf::ConfResult set (
const std::string &name, SocketCb *socket_cb,
1176 std::string &errstr) = 0;
1180 std::string &errstr) = 0;
1184 RebalanceCb *rebalance_cb,
1185 std::string &errstr) = 0;
1189 OffsetCommitCb *offset_commit_cb,
1190 std::string &errstr) = 0;
1197 SslCertificateVerifyCb *ssl_cert_verify_cb,
1198 std::string &errstr) = 0;
1230 RdKafka::CertificateEncoding cert_enc,
1231 const void *buffer,
size_t size,
1232 std::string &errstr) = 0;
1246 std::string &value)
const = 0;
1257 OAuthBearerTokenRefreshCb *&oauthbearer_token_refresh_cb)
const = 0;
1272 virtual Conf::ConfResult get(PartitionerKeyPointerCb *&partitioner_kp_cb)
const = 0;
1295 virtual Conf::ConfResult get(SslCertificateVerifyCb *&ssl_cert_verify_cb)
const = 0;
1299 virtual std::list<std::string> *dump () = 0;
1302 virtual Conf::ConfResult set (
const std::string &name, ConsumeCb *consume_cb,
1303 std::string &errstr) = 0;
1321 virtual struct rd_kafka_conf_s *c_ptr_global () = 0;
1340 virtual struct rd_kafka_topic_conf_s *c_ptr_topic () = 0;
1360 virtual const std::string name ()
const = 0;
1370 virtual const std::string memberid ()
const = 0;
1395 virtual int poll (
int timeout_ms) = 0;
1403 virtual int outq_len () = 0;
1420 virtual ErrorCode metadata (
bool all_topics,
const Topic *only_rkt,
1421 Metadata **metadatap,
int timeout_ms) = 0;
1433 virtual ErrorCode pause (std::vector<TopicPartition*> &partitions) = 0;
1445 virtual ErrorCode resume (std::vector<TopicPartition*> &partitions) = 0;
1456 virtual ErrorCode query_watermark_offsets (
const std::string &topic,
1458 int64_t *low, int64_t *high,
1459 int timeout_ms) = 0;
1478 virtual ErrorCode get_watermark_offsets (
const std::string &topic,
1480 int64_t *low, int64_t *high) = 0;
1504 virtual ErrorCode offsetsForTimes (std::vector<TopicPartition*> &offsets,
1505 int timeout_ms) = 0;
1534 virtual ErrorCode set_log_queue (
Queue *queue) = 0;
1547 virtual void yield () = 0;
1563 virtual const std::string clusterid (
int timeout_ms) = 0;
1581 virtual struct rd_kafka_s *c_ptr () = 0;
1598 virtual int32_t controllerid (
int timeout_ms) = 0;
1622 virtual ErrorCode fatal_error (std::string &errstr)
const = 0;
1663 virtual ErrorCode oauthbearer_set_token (
const std::string &token_value,
1664 int64_t md_lifetime_ms,
1665 const std::string &md_principal_name,
1666 const std::list<std::string> &extensions,
1667 std::string &errstr) = 0;
1686 virtual ErrorCode oauthbearer_set_token_failure (
const std::string &errstr) = 0;
1715 static TopicPartition *create (
const std::string &topic,
int partition);
1723 static TopicPartition *create (
const std::string &topic,
int partition,
1732 static void destroy (std::vector<TopicPartition*> &partitions);
1735 virtual const std::string &topic ()
const = 0;
1738 virtual int partition ()
const = 0;
1741 virtual int64_t offset ()
const = 0;
1744 virtual void set_offset (int64_t offset) = 0;
1747 virtual ErrorCode err ()
const = 0;
1782 static Topic *create (
Handle *base,
const std::string &topic_str,
1783 const Conf *conf, std::string &errstr);
1785 virtual ~
Topic () = 0;
1789 virtual const std::string name ()
const = 0;
1796 virtual bool partition_available (int32_t partition)
const = 0;
1809 virtual ErrorCode offset_store (int32_t partition, int64_t offset) = 0;
1827 virtual struct rd_kafka_topic_s *c_ptr () = 0;
1858 MSG_TIMESTAMP_LOG_APPEND_TIME
1902 key_(key), err_(ERR_NO_ERROR), value_size_(value_size) {
1903 value_ = copy_value(value, value_size);
1922 const RdKafka::ErrorCode err):
1923 key_(key), err_(err), value_(NULL), value_size_(value_size) {
1924 if (err == ERR_NO_ERROR)
1925 value_ = copy_value(value, value_size);
1934 key_(other.key_), err_(other.err_), value_size_(other.value_size_) {
1935 value_ = copy_value(other.value_, value_size_);
1945 if (&other ==
this) {
1951 value_size_ = other.value_size_;
1956 value_ = copy_value(other.value_, value_size_);
1979 return static_cast<const char *
>(value_);
1988 RdKafka::ErrorCode
err()
const {
1993 char *copy_value(
const void *value,
size_t value_size) {
1997 char *dest = (
char *)malloc(value_size + 1);
1998 memcpy(dest, (
const char *)value, value_size);
1999 dest[value_size] =
'\0';
2005 RdKafka::ErrorCode err_;
2008 void *
operator new(size_t);
2016 static Headers *create();
2026 static Headers *create(
const std::vector<Header> &headers);
2037 virtual ErrorCode add(
const std::string &key,
const void *value,
2038 size_t value_size) = 0;
2050 virtual ErrorCode add(
const std::string &key,
const std::string &value) = 0;
2061 virtual ErrorCode add(
const Header &header) = 0;
2070 virtual ErrorCode
remove(
const std::string &key) = 0;
2081 virtual std::vector<Header>
get(
const std::string &key)
const = 0;
2093 virtual Header get_last(
const std::string &key)
const = 0;
2100 virtual std::vector<Header> get_all()
const = 0;
2105 virtual size_t size()
const = 0;
2128 MSG_STATUS_NOT_PERSISTED = 0,
2133 MSG_STATUS_POSSIBLY_PERSISTED = 1,
2138 MSG_STATUS_PERSISTED = 2,
2148 virtual std::string errstr()
const = 0;
2151 virtual ErrorCode err ()
const = 0;
2157 virtual Topic *topic ()
const = 0;
2160 virtual std::string topic_name ()
const = 0;
2163 virtual int32_t partition ()
const = 0;
2166 virtual void *payload ()
const = 0 ;
2169 virtual size_t len ()
const = 0;
2172 virtual const std::string *key ()
const = 0;
2175 virtual const void *key_pointer ()
const = 0 ;
2178 virtual size_t key_len ()
const = 0;
2181 virtual int64_t offset ()
const = 0;
2187 virtual void *msg_opaque ()
const = 0;
2193 virtual int64_t latency ()
const = 0;
2211 virtual struct rd_kafka_message_s *c_ptr () = 0;
2216 virtual Status status ()
const = 0;
2234 virtual int32_t broker_id ()
const = 0;
2277 virtual ErrorCode forward (
Queue *dst) = 0;
2291 virtual Message *consume (
int timeout_ms) = 0;
2300 virtual int poll (
int timeout_ms) = 0;
2302 virtual ~
Queue () = 0;
2319 virtual void io_event_enable (
int fd,
const void *payload,
size_t size) = 0;
2377 virtual ErrorCode assignment (std::vector<RdKafka::TopicPartition*> &partitions) = 0;
2381 virtual ErrorCode subscription (std::vector<std::string> &topics) = 0;
2417 virtual ErrorCode subscribe (
const std::vector<std::string> &topics) = 0;
2420 virtual ErrorCode unsubscribe () = 0;
2428 virtual ErrorCode assign (
const std::vector<TopicPartition*> &partitions) = 0;
2433 virtual ErrorCode unassign () = 0;
2459 virtual Message *consume (
int timeout_ms) = 0;
2474 virtual ErrorCode commitSync () = 0;
2481 virtual ErrorCode commitAsync () = 0;
2492 virtual ErrorCode commitSync (
Message *message) = 0;
2503 virtual ErrorCode commitAsync (
Message *message) = 0;
2514 virtual ErrorCode commitSync (std::vector<TopicPartition*> &offsets) = 0;
2525 virtual ErrorCode commitAsync (
const std::vector<TopicPartition*> &offsets) = 0;
2537 virtual ErrorCode commitSync (
OffsetCommitCb *offset_commit_cb) = 0;
2549 virtual ErrorCode commitSync (std::vector<TopicPartition*> &offsets,
2563 virtual ErrorCode committed (std::vector<TopicPartition*> &partitions,
2564 int timeout_ms) = 0;
2574 virtual ErrorCode position (std::vector<TopicPartition*> &partitions) = 0;
2599 virtual ErrorCode close () = 0;
2619 virtual ErrorCode seek (
const TopicPartition &partition,
int timeout_ms) = 0;
2639 virtual ErrorCode offsets_store (std::vector<TopicPartition*> &offsets) = 0;
2684 static Consumer *create (
const Conf *conf, std::string &errstr);
2708 virtual ErrorCode start (
Topic *topic, int32_t partition, int64_t offset) = 0;
2716 virtual ErrorCode start (
Topic *topic, int32_t partition, int64_t offset,
2728 virtual ErrorCode stop (
Topic *topic, int32_t partition) = 0;
2744 virtual ErrorCode seek (
Topic *topic, int32_t partition, int64_t offset,
2745 int timeout_ms) = 0;
2764 virtual Message *consume (
Topic *topic, int32_t partition,
2765 int timeout_ms) = 0;
2788 virtual Message *consume (
Queue *queue,
int timeout_ms) = 0;
2809 virtual int consume_callback (
Topic *topic, int32_t partition,
2820 virtual int consume_callback (
Queue *queue,
int timeout_ms,
2833 static int64_t OffsetTail(int64_t offset);
2861 static Producer *create (
const Conf *conf, std::string &errstr);
2902 MSG_FREE = RK_MSG_FREE,
2903 MSG_COPY = RK_MSG_COPY
2964 virtual ErrorCode produce (
Topic *topic, int32_t partition,
2966 void *payload,
size_t len,
2967 const std::string *key,
2968 void *msg_opaque) = 0;
2974 virtual ErrorCode produce (
Topic *topic, int32_t partition,
2976 void *payload,
size_t len,
2977 const void *key,
size_t key_len,
2978 void *msg_opaque) = 0;
2986 virtual ErrorCode produce (
const std::string topic_name, int32_t partition,
2988 void *payload,
size_t len,
2989 const void *key,
size_t key_len,
2990 int64_t timestamp,
void *msg_opaque) = 0;
2999 virtual ErrorCode produce (
const std::string topic_name, int32_t partition,
3001 void *payload,
size_t len,
3002 const void *key,
size_t key_len,
3005 void *msg_opaque) = 0;
3012 virtual ErrorCode produce (
Topic *topic, int32_t partition,
3013 const std::vector<char> *payload,
3014 const std::vector<char> *key,
3015 void *msg_opaque) = 0;
3030 virtual ErrorCode flush (
int timeout_ms) = 0;
3060 virtual ErrorCode purge (
int purge_flags) = 0;
3068 PURGE_INFLIGHT = 0x2,
3075 PURGE_NON_BLOCKING = 0x4
3105 virtual Error *init_transactions (
int timeout_ms) = 0;
3120 virtual Error *begin_transaction () = 0;
3168 virtual Error *send_offsets_to_transaction (
3169 const std::vector<TopicPartition*> &offsets,
3171 int timeout_ms) = 0;
3194 virtual Error *commit_transaction (
int timeout_ms) = 0;
3219 virtual Error *abort_transaction (
int timeout_ms) = 0;
3240 virtual int32_t
id()
const = 0;
3243 virtual const std::string
host()
const = 0;
3246 virtual int port()
const = 0;
3270 virtual int32_t
id()
const = 0;
3273 virtual ErrorCode
err()
const = 0;
3276 virtual int32_t
leader()
const = 0;
3279 virtual const std::vector<int32_t> *
replicas()
const = 0;
3284 virtual const std::vector<int32_t> *
isrs()
const = 0;
3302 virtual const std::string
topic()
const = 0;
3305 virtual const PartitionMetadataVector *
partitions()
const = 0;
3308 virtual ErrorCode
err()
const = 0;
3335 virtual const BrokerMetadataVector *
brokers()
const = 0;
3342 virtual const TopicMetadataVector *
topics()
const = 0;
virtual int32_t partitioner_cb(const Topic *topic, const void *key, size_t key_len, int32_t partition_cnt, void *msg_opaque)=0
Variant partitioner callback that gets key as pointer and length instead of as a const std::string *...
High-level KafkaConsumer (for brokers 0.9 and later)
Definition: rdkafkacpp.h:2357
Definition: rdkafkacpp.h:1857
static const int64_t OFFSET_BEGINNING
Special offsets.
Definition: rdkafkacpp.h:1767
ConfType
Configuration object type.
Definition: rdkafkacpp.h:1099
Partitioner callback class.
Definition: rdkafkacpp.h:698
Type
Event type.
Definition: rdkafkacpp.h:776
SASL/OAUTHBEARER token refresh callback class.
Definition: rdkafkacpp.h:680
static const int32_t PARTITION_UA
Unassigned partition.
Definition: rdkafkacpp.h:1764
Message object.
Definition: rdkafkacpp.h:2120
Severity
EVENT_LOG severities (conforms to syslog(3) severities)
Definition: rdkafkacpp.h:784
Event callback class.
Definition: rdkafkacpp.h:757
Status
Message persistence status can be used by the application to find out if a produced message was persi...
Definition: rdkafkacpp.h:2124
KafkaConsumer: Rebalance callback class
Definition: rdkafkacpp.h:885
int64_t timestamp
Definition: rdkafkacpp.h:1862
Variant partitioner with key pointer.
Definition: rdkafkacpp.h:728
Definition: rdkafkacpp.h:779
static const int64_t OFFSET_INVALID
Definition: rdkafkacpp.h:1770
Definition: rdkafkacpp.h:1856
Topic handle.
Definition: rdkafkacpp.h:1756
Producer.
Definition: rdkafkacpp.h:2849
Definition: rdkafkacpp.h:1100
Definition: rdkafkacpp.h:777
ConfResult
RdKafka::Conf::Set() result code.
Definition: rdkafkacpp.h:1107
Definition: rdkafkacpp.h:93
Queue interface.
Definition: rdkafkacpp.h:2260
MessageTimestampType type
Definition: rdkafkacpp.h:1861
Message timestamp object.
Definition: rdkafkacpp.h:1852
static const int64_t OFFSET_END
Definition: rdkafkacpp.h:1768
Portability: OpenCb callback class
Definition: rdkafkacpp.h:1055
SSL broker certificate verification class.
Definition: rdkafkacpp.h:977
Definition: rdkafkacpp.h:778
static const int64_t OFFSET_STORED
Definition: rdkafkacpp.h:1769
Configuration interface.
Definition: rdkafkacpp.h:1094
Offset Commit callback class.
Definition: rdkafkacpp.h:947
Base handle, super class for specific clients.
Definition: rdkafkacpp.h:1355
Topic+Partition.
Definition: rdkafkacpp.h:1708
The Error class is used as a return value from APIs to propagate an error. The error consists of an e...
Definition: rdkafkacpp.h:557
Consume callback class.
Definition: rdkafkacpp.h:867
Simple Consumer (legacy)
Definition: rdkafkacpp.h:2672
MessageTimestampType
Definition: rdkafkacpp.h:1855
Event object class as passed to the EventCb callback.
Definition: rdkafkacpp.h:773
Portability: SocketCb callback class
Definition: rdkafkacpp.h:1030
Delivery Report callback class.
Definition: rdkafkacpp.h:642