57 #ifdef LIBRDKAFKACPP_EXPORTS 58 #define RD_EXPORT __declspec(dllexport) 60 #define RD_EXPORT __declspec(dllimport) 90 #define RD_KAFKA_VERSION 0x000902ff 104 std::string version_str();
111 std::string get_debug_contexts();
123 int wait_destroyed(
int timeout_ms);
351 virtual void dr_cb (
Message &message) = 0;
382 virtual int32_t partitioner_cb (
const Topic *topic,
383 const std::string *key,
384 int32_t partition_cnt,
385 void *msg_opaque) = 0;
404 virtual int32_t partitioner_cb (
const Topic *topic,
407 int32_t partition_cnt,
408 void *msg_opaque) = 0;
430 virtual void event_cb (
Event &event) = 0;
451 EVENT_SEVERITY_EMERG = 0,
452 EVENT_SEVERITY_ALERT = 1,
453 EVENT_SEVERITY_CRITICAL = 2,
454 EVENT_SEVERITY_ERROR = 3,
455 EVENT_SEVERITY_WARNING = 4,
456 EVENT_SEVERITY_NOTICE = 5,
457 EVENT_SEVERITY_INFO = 6,
458 EVENT_SEVERITY_DEBUG = 7
461 virtual ~
Event () { }
471 virtual Type type ()
const = 0;
483 virtual Severity severity ()
const = 0;
489 virtual std::string fac ()
const = 0;
499 virtual std::string str ()
const = 0;
505 virtual int throttle_time ()
const = 0;
511 virtual std::string broker_name ()
const = 0;
517 virtual int broker_id ()
const = 0;
534 virtual void consume_cb (
Message &message,
void *opaque) = 0;
596 std::vector<TopicPartition*>&partitions) = 0;
624 std::vector<TopicPartition*>&offsets) = 0;
650 virtual int socket_cb (
int domain,
int type,
int protocol) = 0;
673 virtual int open_cb (
const std::string &path,
int flags,
int mode) = 0;
732 const std::string &value,
733 std::string &errstr) = 0;
738 std::string &errstr) = 0;
743 std::string &errstr) = 0;
753 const Conf *topic_conf,
754 std::string &errstr) = 0;
759 std::string &errstr) = 0;
764 std::string &errstr) = 0;
768 std::string &errstr) = 0;
772 std::string &errstr) = 0;
777 std::string &errstr) = 0;
782 std::string &errstr) = 0;
788 std::string &value)
const = 0;
792 virtual std::list<std::string> *dump () = 0;
812 virtual const std::string name ()
const = 0;
822 virtual const std::string memberid ()
const = 0;
847 virtual int poll (
int timeout_ms) = 0;
855 virtual int outq_len () = 0;
872 virtual ErrorCode metadata (
bool all_topics,
const Topic *only_rkt,
873 Metadata **metadatap,
int timeout_ms) = 0;
885 virtual ErrorCode pause (std::vector<TopicPartition*> &partitions) = 0;
897 virtual ErrorCode resume (std::vector<TopicPartition*> &partitions) = 0;
908 virtual ErrorCode query_watermark_offsets (
const std::string &topic,
910 int64_t *low, int64_t *high,
930 virtual ErrorCode get_watermark_offsets (
const std::string &topic,
932 int64_t *low, int64_t *high) = 0;
961 static TopicPartition *create (
const std::string &topic,
int partition);
966 virtual const std::string &topic ()
const = 0;
969 virtual int partition () = 0;
972 virtual int64_t offset () = 0;
975 virtual void set_offset (int64_t offset) = 0;
995 static const int32_t PARTITION_UA = -1;
998 static const int64_t OFFSET_BEGINNING = -2;
999 static const int64_t OFFSET_END = -1;
1000 static const int64_t OFFSET_STORED = -1000;
1001 static const int64_t OFFSET_INVALID = -1001;
1013 static Topic *create (
Handle *base,
const std::string &topic_str,
1014 Conf *conf, std::string &errstr);
1016 virtual ~
Topic () = 0;
1020 virtual const std::string name ()
const = 0;
1027 virtual bool partition_available (int32_t partition)
const = 0;
1040 virtual ErrorCode offset_store (int32_t partition, int64_t offset) = 0;
1070 MSG_TIMESTAMP_LOG_APPEND_TIME
1099 virtual std::string errstr()
const = 0;
1108 virtual Topic *topic ()
const = 0;
1111 virtual std::string topic_name ()
const = 0;
1114 virtual int32_t partition ()
const = 0;
1117 virtual void *payload ()
const = 0 ;
1120 virtual size_t len ()
const = 0;
1123 virtual const std::string *key ()
const = 0;
1126 virtual const void *key_pointer ()
const = 0 ;
1129 virtual size_t key_len ()
const = 0;
1132 virtual int64_t offset ()
const = 0;
1138 virtual void *msg_opaque ()
const = 0;
1173 virtual ~
Queue () { }
1214 virtual ErrorCode assignment (std::vector<RdKafka::TopicPartition*> &partitions) = 0;
1218 virtual ErrorCode subscription (std::vector<std::string> &topics) = 0;
1242 virtual ErrorCode subscribe (
const std::vector<std::string> &topics) = 0;
1253 virtual ErrorCode assign (
const std::vector<TopicPartition*> &partitions) = 0;
1284 virtual Message *consume (
int timeout_ms) = 0;
1331 virtual ErrorCode commitSync (std::vector<TopicPartition*> &offsets) = 0;
1338 virtual ErrorCode commitAsync (
const std::vector<TopicPartition*> &offsets) = 0;
1349 virtual ErrorCode committed (std::vector<TopicPartition*> &partitions,
1350 int timeout_ms) = 0;
1360 virtual ErrorCode position (std::vector<TopicPartition*> &partitions) = 0;
1415 static Consumer *create (
Conf *conf, std::string &errstr);
1439 virtual ErrorCode start (
Topic *topic, int32_t partition, int64_t offset) = 0;
1447 virtual ErrorCode start (
Topic *topic, int32_t partition, int64_t offset,
1475 virtual ErrorCode seek (
Topic *topic, int32_t partition, int64_t offset,
1476 int timeout_ms) = 0;
1495 virtual Message *consume (
Topic *topic, int32_t partition,
1496 int timeout_ms) = 0;
1519 virtual Message *consume (
Queue *queue,
int timeout_ms) = 0;
1540 virtual int consume_callback (
Topic *topic, int32_t partition,
1551 virtual int consume_callback (
Queue *queue,
int timeout_ms,
1564 static int64_t OffsetTail(int64_t offset);
1592 static Producer *create (
Conf *conf, std::string &errstr);
1602 static const int RK_MSG_FREE = 0x1;
1604 static const int RK_MSG_COPY = 0x2;
1608 static const int RK_MSG_BLOCK = 0x4;
1627 static const int MSG_FREE = RK_MSG_FREE;
1628 static const int MSG_COPY = RK_MSG_COPY;
1688 void *payload,
size_t len,
1689 const std::string *key,
1690 void *msg_opaque) = 0;
1698 void *payload,
size_t len,
1699 const void *key,
size_t key_len,
1700 void *msg_opaque) = 0;
1708 const std::vector<char> *payload,
1709 const std::vector<char> *key,
1710 void *msg_opaque) = 0;
1724 virtual ErrorCode flush (
int timeout_ms) = 0;
1743 virtual int32_t id()
const = 0;
1746 virtual const std::string host()
const = 0;
1749 virtual int port()
const = 0;
1773 virtual int32_t id()
const = 0;
1779 virtual int32_t leader()
const = 0;
1782 virtual const std::vector<int32_t> *replicas()
const = 0;
1787 virtual const std::vector<int32_t> *isrs()
const = 0;
1805 virtual const std::string topic()
const = 0;
1808 virtual const PartitionMetadataVector *partitions()
const = 0;
1834 virtual const BrokerMetadataVector *brokers()
const = 0;
1837 virtual const TopicMetadataVector *topics()
const = 0;
1840 virtual int32_t orig_broker_id()
const = 0;
1843 virtual const std::string orig_broker_name()
const = 0;
Definition: rdkafkacpp.h:174
Definition: rdkafkacpp.h:275
Definition: rdkafkacpp.h:167
Definition: rdkafkacpp.h:277
Definition: rdkafkacpp.h:220
High-level KafkaConsumer (for brokers 0.9 and later)
Definition: rdkafkacpp.h:1194
Definition: rdkafkacpp.h:1069
Definition: rdkafkacpp.h:190
ConfType
Configuration object type.
Definition: rdkafkacpp.h:704
Partitioner callback class.
Definition: rdkafkacpp.h:364
Definition: rdkafkacpp.h:255
Definition: rdkafkacpp.h:241
Definition: rdkafkacpp.h:281
Type
Event type.
Definition: rdkafkacpp.h:442
Definition: rdkafkacpp.h:161
Definition: rdkafkacpp.h:218
Definition: rdkafkacpp.h:267
Definition: rdkafkacpp.h:165
Definition: rdkafkacpp.h:202
Definition: rdkafkacpp.h:279
Definition: rdkafkacpp.h:163
Definition: rdkafkacpp.h:206
Message object.
Definition: rdkafkacpp.h:1090
Definition: rdkafkacpp.h:184
Definition: rdkafkacpp.h:159
Severity
EVENT_LOG severities (conforms to syslog(3) severities)
Definition: rdkafkacpp.h:450
Event callback class.
Definition: rdkafkacpp.h:423
Definition: rdkafkacpp.h:265
Definition: rdkafkacpp.h:269
Definition: rdkafkacpp.h:291
Definition: rdkafkacpp.h:188
Definition: rdkafkacpp.h:212
Definition: rdkafkacpp.h:196
KafkaConsunmer: Rebalance callback class
Definition: rdkafkacpp.h:543
Definition: rdkafkacpp.h:153
Definition: rdkafkacpp.h:178
Definition: rdkafkacpp.h:180
Definition: rdkafkacpp.h:198
Definition: rdkafkacpp.h:186
int64_t timestamp
Definition: rdkafkacpp.h:1074
Definition: rdkafkacpp.h:285
Variant partitioner with key pointer.
Definition: rdkafkacpp.h:394
Definition: rdkafkacpp.h:251
Definition: rdkafkacpp.h:257
Definition: rdkafkacpp.h:155
Definition: rdkafkacpp.h:249
Definition: rdkafkacpp.h:445
Definition: rdkafkacpp.h:172
Definition: rdkafkacpp.h:204
Definition: rdkafkacpp.h:1068
Definition: rdkafkacpp.h:245
Topic handle.
Definition: rdkafkacpp.h:987
Definition: rdkafkacpp.h:157
Definition: rdkafkacpp.h:237
Definition: rdkafkacpp.h:287
Producer.
Definition: rdkafkacpp.h:1580
Definition: rdkafkacpp.h:151
Definition: rdkafkacpp.h:261
Definition: rdkafkacpp.h:705
Definition: rdkafkacpp.h:443
Definition: rdkafkacpp.h:200
Definition: rdkafkacpp.h:208
ConfResult
RdKafka::Conf::Set() result code.
Definition: rdkafkacpp.h:712
Definition: rdkafkacpp.h:68
Queue interface.
Definition: rdkafkacpp.h:1166
MessageTimestampType type
Definition: rdkafkacpp.h:1073
Message timestamp object.
Definition: rdkafkacpp.h:1065
Definition: rdkafkacpp.h:289
Definition: rdkafkacpp.h:231
Definition: rdkafkacpp.h:223
Definition: rdkafkacpp.h:176
Definition: rdkafkacpp.h:235
Definition: rdkafkacpp.h:194
Definition: rdkafkacpp.h:182
Portability: OpenCb callback class
Definition: rdkafkacpp.h:660
Definition: rdkafkacpp.h:192
Definition: rdkafkacpp.h:233
Definition: rdkafkacpp.h:227
Definition: rdkafkacpp.h:253
Definition: rdkafkacpp.h:444
Definition: rdkafkacpp.h:210
Definition: rdkafkacpp.h:214
Definition: rdkafkacpp.h:283
Configuration interface.
Definition: rdkafkacpp.h:699
Definition: rdkafkacpp.h:239
Definition: rdkafkacpp.h:247
Definition: rdkafkacpp.h:170
Offset Commit callback class.
Definition: rdkafkacpp.h:605
Definition: rdkafkacpp.h:259
Base handle, super class for specific clients.
Definition: rdkafkacpp.h:807
Definition: rdkafkacpp.h:216
RD_EXPORT std::string err2str(RdKafka::ErrorCode err)
Returns a human readable representation of a kafka error.
Definition: rdkafkacpp.h:273
Topic+Partition.
Definition: rdkafkacpp.h:954
Definition: rdkafkacpp.h:263
Consume callback class.
Definition: rdkafkacpp.h:525
Simple Consumer (legacy)
Definition: rdkafkacpp.h:1403
MessageTimestampType
Definition: rdkafkacpp.h:1067
Definition: rdkafkacpp.h:229
Event object class as passed to the EventCb callback.
Definition: rdkafkacpp.h:439
ErrorCode
Error codes.
Definition: rdkafkacpp.h:148
Definition: rdkafkacpp.h:271
Definition: rdkafkacpp.h:243
Portability: SocketCb callback class
Definition: rdkafkacpp.h:635
Delivery Report callback class.
Definition: rdkafkacpp.h:346