mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-02 19:47:55 +00:00
Add initial consumer code
This commit is contained in:
28
include/cppkafka/consumer.h
Normal file
28
include/cppkafka/consumer.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef CPP_KAFKA_CONSUMER_H
|
||||
#define CPP_KAFKA_CONSUMER_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "kafka_handle_base.h"
|
||||
#include "topic_partition_list.h"
|
||||
|
||||
namespace cppkafka {
|
||||
|
||||
class Configuration;
|
||||
class TopicConfiguration;
|
||||
|
||||
class Consumer : public KafkaHandleBase {
|
||||
public:
|
||||
Consumer(const Configuration& config);
|
||||
|
||||
void subscribe(const std::vector<std::string>& topics);
|
||||
void unsubscribe();
|
||||
|
||||
void assign(const TopicPartitionList& topic_partitions);
|
||||
private:
|
||||
void check_error(rd_kafka_resp_err_t error);
|
||||
};
|
||||
|
||||
} // cppkafka
|
||||
|
||||
#endif // CPP_KAFKA_CONSUMER_H
|
||||
Reference in New Issue
Block a user