#ifndef QKAFKAUTIL_H
#define QKAFKAUTIL_H

#include <QObject>

#include "include/librdkafka/rdkafkacpp.h"

class QKafkaUtil : public QObject
{
    Q_OBJECT
public:
    explicit QKafkaUtil(QObject *parent = nullptr);

    void setBrokers(QString brokers);
    void setTopic(QString topic);

    int createProducer();
    int produceMessage(QString message);
    int produceMessage(QString topic, QString message);

private:
    QString brokers;
    QString topic;

    std::string errStr;

    RdKafka::Conf * conf;

    RdKafka::Producer * producer = 0;
signals:

};

#endif // QKAFKAUTIL_H
