Add initial producer code

This commit is contained in:
Matias Fontanini
2016-05-16 20:46:08 -07:00
parent f86c9c1f57
commit 1cc8f027c9
18 changed files with 359 additions and 13 deletions

View File

@@ -3,22 +3,33 @@
#include <stdexcept>
#include <string>
#include <librdkafka/rdkafka.h>
namespace cppkafka {
class KafkaException : public std::exception {
};
class KafkaConfigException : public KafkaException {
class Exception : public std::exception {
public:
KafkaConfigException(const std::string& config_name, const std::string& error);
Exception(std::string message);
const char* what() const noexcept;
private:
std::string message_;
};
class ConfigException : public Exception {
public:
ConfigException(const std::string& config_name, const std::string& error);
};
class HandleException : public Exception {
public:
HandleException(rd_kafka_resp_err_t error_code);
rd_kafka_resp_err_t get_error_code() const;
private:
rd_kafka_resp_err_t error_code_;
};
} // cppkafka
#endif // CPPKAFKA_EXCEPTIONS_H