|
| KafkaConsumer (const Properties &properties) |
| The constructor for KafkaConsumer. More...
|
|
| ~KafkaConsumer () override |
| The destructor for KafkaConsumer.
|
|
void | close () |
| Close the consumer, waiting for any needed cleanup.
|
|
std::string | getGroupId () const |
| To get group ID.
|
|
void | setGroupId (const std::string &id) |
| To set group ID. More...
|
|
void | subscribe (const Topics &topics, consumer::RebalanceCallback rebalanceCallback=consumer::NullRebalanceCallback, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_SUBSCRIBE_TIMEOUT_MS)) |
| Subscribe to the given list of topics to get dynamically assigned partitions. More...
|
|
Topics | subscription () const |
| Get the current subscription.
|
|
void | unsubscribe (std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_UNSUBSCRIBE_TIMEOUT_MS)) |
| Unsubscribe from topics currently subscribed.
|
|
void | assign (const TopicPartitions &topicPartitions) |
| Manually assign a list of partitions to this consumer. More...
|
|
TopicPartitions | assignment () const |
| Get the set of partitions currently assigned to this consumer.
|
|
void | seek (const TopicPartition &topicPartition, Offset offset, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_SEEK_TIMEOUT_MS)) |
| Overrides the fetch offsets that the consumer will use on the next poll(timeout). More...
|
|
void | seekToBeginning (const TopicPartitions &topicPartitions, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_SEEK_TIMEOUT_MS)) |
| Seek to the first offset for each of the given partitions. More...
|
|
void | seekToBeginning (std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_SEEK_TIMEOUT_MS)) |
|
void | seekToEnd (const TopicPartitions &topicPartitions, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_SEEK_TIMEOUT_MS)) |
| Seek to the last offset for each of the given partitions. More...
|
|
void | seekToEnd (std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_SEEK_TIMEOUT_MS)) |
|
Offset | position (const TopicPartition &topicPartition) const |
| Get the offset of the next record that will be fetched (if a record with that offset exists).
|
|
std::map< TopicPartition, Offset > | beginningOffsets (const TopicPartitions &topicPartitions, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_QUERY_TIMEOUT_MS)) const |
| Get the first offset for the given partitions. More...
|
|
std::map< TopicPartition, Offset > | endOffsets (const TopicPartitions &topicPartitions, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_QUERY_TIMEOUT_MS)) const |
| Get the last offset for the given partitions. More...
|
|
std::map< TopicPartition, Offset > | offsetsForTime (const TopicPartitions &topicPartitions, std::chrono::time_point< std::chrono::system_clock > timepoint, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_QUERY_TIMEOUT_MS)) const |
| Get the offsets for the given partitions by time-point. More...
|
|
void | commitSync () |
| Commit offsets returned on the last poll() for all the subscribed list of topics and partitions.
|
|
void | commitSync (const consumer::ConsumerRecord &record) |
| Commit the specified offsets for the specified records.
|
|
void | commitSync (const TopicPartitionOffsets &topicPartitionOffsets) |
| Commit the specified offsets for the specified list of topics and partitions.
|
|
void | commitAsync (const consumer::OffsetCommitCallback &offsetCommitCallback=consumer::NullOffsetCommitCallback) |
| Commit offsets returned on the last poll() for all the subscribed list of topics and partition. More...
|
|
void | commitAsync (const consumer::ConsumerRecord &record, const consumer::OffsetCommitCallback &offsetCommitCallback=consumer::NullOffsetCommitCallback) |
| Commit the specified offsets for the specified records Note: If a callback is provided, it's guaranteed to be triggered (before closing the consumer).
|
|
void | commitAsync (const TopicPartitionOffsets &topicPartitionOffsets, const consumer::OffsetCommitCallback &offsetCommitCallback=consumer::NullOffsetCommitCallback) |
| Commit the specified offsets for the specified list of topics and partitions to Kafka. More...
|
|
Offset | committed (const TopicPartition &topicPartition) |
| Get the last committed offset for the given partition (whether the commit happened by this process or another).This offset will be used as the position for the consumer in the event of a failure. More...
|
|
std::vector< consumer::ConsumerRecord > | poll (std::chrono::milliseconds timeout) |
| Fetch data for the topics or partitions specified using one of the subscribe/assign APIs. More...
|
|
void | pause (const TopicPartitions &topicPartitions) |
| Suspend fetching from the requested partitions. More...
|
|
void | pause () |
| Suspend fetching from all assigned partitions. More...
|
|
void | resume (const TopicPartitions &topicPartitions) |
| Resume specified partitions which have been paused with pause(). More...
|
|
void | resume () |
| Resume all partitions which have been paused with pause(). More...
|
|
consumer::ConsumerGroupMetadata | groupMetadata () |
| Return the current group metadata associated with this consumer.
|
|
const std::string & | clientId () const |
| Get the client id.
|
|
const std::string & | name () const |
| Get the client name (i.e. More...
|
|
void | setLogLevel (int level) |
| Set log level for the kafka client (the default value: 5).
|
|
const Properties & | properties () const |
| Return the properties which took effect.
|
|
Optional< std::string > | getProperty (const std::string &name) const |
| Fetch the effected property (including the property internally set by librdkafka).
|
|
void | pollEvents (std::chrono::milliseconds timeout) |
| Call the OffsetCommit callbacks (if any) Note: The Kafka client should be constructed with option enable.manual.events.poll=true !
|
|
Optional< BrokerMetadata > | fetchBrokerMetadata (const std::string &topic, std::chrono::milliseconds timeout=std::chrono::milliseconds(DEFAULT_METADATA_TIMEOUT_MS), bool disableErrorLogging=false) |
| Fetch matadata from a available broker. More...
|
|
template<class ... Args> |
void | doLog (int level, const char *filename, int lineno, const char *format, Args... args) const |
|
void | doLog (int level, const char *filename, int lineno, const char *msg) const |
|