57 #ifdef LIBRDKAFKA_STATICLIB 60 #ifdef LIBRDKAFKACPP_EXPORTS 61 #define RD_EXPORT __declspec(dllexport) 63 #define RD_EXPORT __declspec(dllimport) 94 #define RD_KAFKA_VERSION 0x000905ff 108 std::string version_str();
115 std::string get_debug_contexts();
127 int wait_destroyed(
int timeout_ms);
359 virtual void dr_cb (
Message &message) = 0;
390 virtual int32_t partitioner_cb (
const Topic *topic,
391 const std::string *key,
392 int32_t partition_cnt,
393 void *msg_opaque) = 0;
412 virtual int32_t partitioner_cb (
const Topic *topic,
415 int32_t partition_cnt,
416 void *msg_opaque) = 0;
438 virtual void event_cb (
Event &event) = 0;
459 EVENT_SEVERITY_EMERG = 0,
460 EVENT_SEVERITY_ALERT = 1,
461 EVENT_SEVERITY_CRITICAL = 2,
462 EVENT_SEVERITY_ERROR = 3,
463 EVENT_SEVERITY_WARNING = 4,
464 EVENT_SEVERITY_NOTICE = 5,
465 EVENT_SEVERITY_INFO = 6,
466 EVENT_SEVERITY_DEBUG = 7
469 virtual ~
Event () { }
479 virtual Type type ()
const = 0;
491 virtual Severity severity ()
const = 0;
497 virtual std::string fac ()
const = 0;
507 virtual std::string str ()
const = 0;
513 virtual int throttle_time ()
const = 0;
519 virtual std::string broker_name ()
const = 0;
525 virtual int broker_id ()
const = 0;
542 virtual void consume_cb (
Message &message,
void *opaque) = 0;
604 std::vector<TopicPartition*>&partitions) = 0;
631 std::vector<TopicPartition*>&offsets) = 0;
657 virtual int socket_cb (
int domain,
int type,
int protocol) = 0;
680 virtual int open_cb (
const std::string &path,
int flags,
int mode) = 0;
747 const std::string &value,
748 std::string &errstr) = 0;
752 std::string &errstr) = 0;
757 std::string &errstr) = 0;
762 std::string &errstr) = 0;
772 const Conf *topic_conf,
773 std::string &errstr) = 0;
778 std::string &errstr) = 0;
783 std::string &errstr) = 0;
787 std::string &errstr) = 0;
791 std::string &errstr) = 0;
796 std::string &errstr) = 0;
801 std::string &errstr) = 0;
815 std::string &value)
const = 0;
859 virtual std::list<std::string> *dump () = 0;
879 virtual const std::string name ()
const = 0;
889 virtual const std::string memberid ()
const = 0;
914 virtual int poll (
int timeout_ms) = 0;
922 virtual int outq_len () = 0;
939 virtual ErrorCode metadata (
bool all_topics,
const Topic *only_rkt,
940 Metadata **metadatap,
int timeout_ms) = 0;
952 virtual ErrorCode pause (std::vector<TopicPartition*> &partitions) = 0;
964 virtual ErrorCode resume (std::vector<TopicPartition*> &partitions) = 0;
975 virtual ErrorCode query_watermark_offsets (
const std::string &topic,
977 int64_t *low, int64_t *high,
997 virtual ErrorCode get_watermark_offsets (
const std::string &topic,
999 int64_t *low, int64_t *high) = 0;
1021 virtual ErrorCode offsetsForTimes (std::vector<TopicPartition*> &offsets,
1022 int timeout_ms) = 0;
1081 static TopicPartition *create (
const std::string &topic,
int partition);
1082 static TopicPartition *create (
const std::string &topic,
int partition,
1091 static void destroy (std::vector<TopicPartition*> &partitions);
1094 virtual const std::string &topic ()
const = 0;
1097 virtual int partition ()
const = 0;
1100 virtual int64_t offset ()
const = 0;
1103 virtual void set_offset (int64_t offset) = 0;
1141 static Topic *create (
Handle *base,
const std::string &topic_str,
1142 Conf *conf, std::string &errstr);
1144 virtual ~
Topic () = 0;
1148 virtual const std::string name ()
const = 0;
1155 virtual bool partition_available (int32_t partition)
const = 0;
1168 virtual ErrorCode offset_store (int32_t partition, int64_t offset) = 0;
1198 MSG_TIMESTAMP_LOG_APPEND_TIME
1227 virtual std::string errstr()
const = 0;
1236 virtual Topic *topic ()
const = 0;
1239 virtual std::string topic_name ()
const = 0;
1242 virtual int32_t partition ()
const = 0;
1245 virtual void *payload ()
const = 0 ;
1248 virtual size_t len ()
const = 0;
1251 virtual const std::string *key ()
const = 0;
1254 virtual const void *key_pointer ()
const = 0 ;
1257 virtual size_t key_len ()
const = 0;
1260 virtual int64_t offset ()
const = 0;
1266 virtual void *msg_opaque ()
const = 0;
1325 virtual Message *consume (
int timeout_ms) = 0;
1334 virtual int poll (
int timeout_ms) = 0;
1336 virtual ~
Queue () = 0;
1377 virtual ErrorCode assignment (std::vector<RdKafka::TopicPartition*> &partitions) = 0;
1381 virtual ErrorCode subscription (std::vector<std::string> &topics) = 0;
1407 virtual ErrorCode subscribe (
const std::vector<std::string> &topics) = 0;
1418 virtual ErrorCode assign (
const std::vector<TopicPartition*> &partitions) = 0;
1449 virtual Message *consume (
int timeout_ms) = 0;
1496 virtual ErrorCode commitSync (std::vector<TopicPartition*> &offsets) = 0;
1503 virtual ErrorCode commitAsync (
const std::vector<TopicPartition*> &offsets) = 0;
1527 virtual ErrorCode commitSync (std::vector<TopicPartition*> &offsets,
1541 virtual ErrorCode committed (std::vector<TopicPartition*> &partitions,
1542 int timeout_ms) = 0;
1552 virtual ErrorCode position (std::vector<TopicPartition*> &partitions) = 0;
1607 static Consumer *create (
Conf *conf, std::string &errstr);
1631 virtual ErrorCode start (
Topic *topic, int32_t partition, int64_t offset) = 0;
1639 virtual ErrorCode start (
Topic *topic, int32_t partition, int64_t offset,
1667 virtual ErrorCode seek (
Topic *topic, int32_t partition, int64_t offset,
1668 int timeout_ms) = 0;
1687 virtual Message *consume (
Topic *topic, int32_t partition,
1688 int timeout_ms) = 0;
1711 virtual Message *consume (
Queue *queue,
int timeout_ms) = 0;
1732 virtual int consume_callback (
Topic *topic, int32_t partition,
1743 virtual int consume_callback (
Queue *queue,
int timeout_ms,
1756 static int64_t OffsetTail(int64_t offset);
1784 static Producer *create (
Conf *conf, std::string &errstr);
1823 MSG_FREE = RK_MSG_FREE,
1824 MSG_COPY = RK_MSG_COPY
1885 void *payload,
size_t len,
1886 const std::string *key,
1887 void *msg_opaque) = 0;
1895 void *payload,
size_t len,
1896 const void *key,
size_t key_len,
1897 void *msg_opaque) = 0;
1905 virtual ErrorCode produce (
const std::string topic_name, int32_t partition,
1907 void *payload,
size_t len,
1908 const void *key,
size_t key_len,
1910 void *msg_opaque) = 0;
1918 const std::vector<char> *payload,
1919 const std::vector<char> *key,
1920 void *msg_opaque) = 0;
1934 virtual ErrorCode flush (
int timeout_ms) = 0;
1953 virtual int32_t id()
const = 0;
1956 virtual const std::string host()
const = 0;
1959 virtual int port()
const = 0;
1983 virtual int32_t id()
const = 0;
1989 virtual int32_t leader()
const = 0;
1992 virtual const std::vector<int32_t> *replicas()
const = 0;
1997 virtual const std::vector<int32_t> *isrs()
const = 0;
2015 virtual const std::string topic()
const = 0;
2018 virtual const PartitionMetadataVector *partitions()
const = 0;
2044 virtual const BrokerMetadataVector *brokers()
const = 0;
2047 virtual const TopicMetadataVector *topics()
const = 0;
2050 virtual int32_t orig_broker_id()
const = 0;
2053 virtual const std::string orig_broker_name()
const = 0;
Definition: rdkafkacpp.h:178
Definition: rdkafkacpp.h:282
Definition: rdkafkacpp.h:171
Definition: rdkafkacpp.h:284
Definition: rdkafkacpp.h:224
Definition: rdkafkacpp.h:226
High-level KafkaConsumer (for brokers 0.9 and later)
Definition: rdkafkacpp.h:1357
Definition: rdkafkacpp.h:1197
static const int64_t OFFSET_BEGINNING
Special offsets.
Definition: rdkafkacpp.h:1126
Definition: rdkafkacpp.h:194
ConfType
Configuration object type.
Definition: rdkafkacpp.h:711
Partitioner callback class.
Definition: rdkafkacpp.h:372
Definition: rdkafkacpp.h:262
Definition: rdkafkacpp.h:248
Definition: rdkafkacpp.h:288
Type
Event type.
Definition: rdkafkacpp.h:450
Definition: rdkafkacpp.h:165
Definition: rdkafkacpp.h:222
Definition: rdkafkacpp.h:274
Definition: rdkafkacpp.h:169
Definition: rdkafkacpp.h:206
Definition: rdkafkacpp.h:286
Definition: rdkafkacpp.h:167
static const int32_t PARTITION_UA
Unassigned partition.
Definition: rdkafkacpp.h:1123
Definition: rdkafkacpp.h:210
Message object.
Definition: rdkafkacpp.h:1218
Definition: rdkafkacpp.h:188
Definition: rdkafkacpp.h:163
Severity
EVENT_LOG severities (conforms to syslog(3) severities)
Definition: rdkafkacpp.h:458
Event callback class.
Definition: rdkafkacpp.h:431
Definition: rdkafkacpp.h:272
Definition: rdkafkacpp.h:276
Definition: rdkafkacpp.h:298
Definition: rdkafkacpp.h:192
Definition: rdkafkacpp.h:216
Definition: rdkafkacpp.h:200
KafkaConsunmer: Rebalance callback class
Definition: rdkafkacpp.h:551
Definition: rdkafkacpp.h:157
Definition: rdkafkacpp.h:182
Definition: rdkafkacpp.h:184
Definition: rdkafkacpp.h:202
Definition: rdkafkacpp.h:190
int64_t timestamp
Definition: rdkafkacpp.h:1202
Definition: rdkafkacpp.h:292
Variant partitioner with key pointer.
Definition: rdkafkacpp.h:402
Definition: rdkafkacpp.h:258
Definition: rdkafkacpp.h:264
Definition: rdkafkacpp.h:159
Definition: rdkafkacpp.h:256
Definition: rdkafkacpp.h:453
Definition: rdkafkacpp.h:176
Definition: rdkafkacpp.h:208
Definition: rdkafkacpp.h:228
static const int64_t OFFSET_INVALID
Definition: rdkafkacpp.h:1129
Definition: rdkafkacpp.h:1196
Definition: rdkafkacpp.h:252
Topic handle.
Definition: rdkafkacpp.h:1115
Definition: rdkafkacpp.h:161
Definition: rdkafkacpp.h:244
Definition: rdkafkacpp.h:294
Producer.
Definition: rdkafkacpp.h:1772
Definition: rdkafkacpp.h:155
Definition: rdkafkacpp.h:268
Definition: rdkafkacpp.h:712
Definition: rdkafkacpp.h:451
Definition: rdkafkacpp.h:204
Definition: rdkafkacpp.h:212
ConfResult
RdKafka::Conf::Set() result code.
Definition: rdkafkacpp.h:719
Definition: rdkafkacpp.h:72
Queue interface.
Definition: rdkafkacpp.h:1294
MessageTimestampType type
Definition: rdkafkacpp.h:1201
Message timestamp object.
Definition: rdkafkacpp.h:1193
Definition: rdkafkacpp.h:296
Definition: rdkafkacpp.h:238
Definition: rdkafkacpp.h:230
Definition: rdkafkacpp.h:180
Definition: rdkafkacpp.h:242
static const int64_t OFFSET_END
Definition: rdkafkacpp.h:1127
Definition: rdkafkacpp.h:198
Definition: rdkafkacpp.h:186
Portability: OpenCb callback class
Definition: rdkafkacpp.h:667
Definition: rdkafkacpp.h:196
Definition: rdkafkacpp.h:240
Definition: rdkafkacpp.h:234
Definition: rdkafkacpp.h:260
Definition: rdkafkacpp.h:452
Definition: rdkafkacpp.h:214
static const int64_t OFFSET_STORED
Definition: rdkafkacpp.h:1128
Definition: rdkafkacpp.h:218
Definition: rdkafkacpp.h:290
Configuration interface.
Definition: rdkafkacpp.h:706
Definition: rdkafkacpp.h:246
Definition: rdkafkacpp.h:254
Definition: rdkafkacpp.h:174
Offset Commit callback class.
Definition: rdkafkacpp.h:613
Definition: rdkafkacpp.h:266
Base handle, super class for specific clients.
Definition: rdkafkacpp.h:874
Definition: rdkafkacpp.h:220
RD_EXPORT std::string err2str(RdKafka::ErrorCode err)
Returns a human readable representation of a kafka error.
Definition: rdkafkacpp.h:280
Topic+Partition.
Definition: rdkafkacpp.h:1073
Definition: rdkafkacpp.h:270
Consume callback class.
Definition: rdkafkacpp.h:533
Simple Consumer (legacy)
Definition: rdkafkacpp.h:1595
MessageTimestampType
Definition: rdkafkacpp.h:1195
Definition: rdkafkacpp.h:236
Event object class as passed to the EventCb callback.
Definition: rdkafkacpp.h:447
ErrorCode
Error codes.
Definition: rdkafkacpp.h:152
Definition: rdkafkacpp.h:278
Definition: rdkafkacpp.h:250
Portability: SocketCb callback class
Definition: rdkafkacpp.h:642
Delivery Report callback class.
Definition: rdkafkacpp.h:354