11#ifndef KafkaManager_hpp
12#define KafkaManager_hpp
14#include <librdkafka/rdkafka.h>
16#include <json/value.h>
17#include <opencv2/core.hpp>
18#include "../constants.hpp"
96 static void dr_msg_cb (rd_kafka_t * kafka_handle,
const rd_kafka_message_t * rkmessage,
void * opaque);
119 void sendData (
const char * key, Json::Value root);
Kafka class is a class that is responsible to send all generated output data, via Apache Kafka techno...
const char * topic
Destination Kafka's topic.
const char * getTopic(void)
Get the destination Kafka's topic.
int getArraySize(const char **array)
Get the "const char *" array size.
KafkaManager(const char *topic)
Construct a new Kafka Manager object.
void setupProducer(void)
Launches configuration loading, once reads all the configuration parameters and later set the produce...
void sendData(const char *key, Json::Value root)
Send data contained in root via Kafka with ID equal to key.
static void dr_msg_cb(rd_kafka_t *kafka_handle, const rd_kafka_message_t *rkmessage, void *opaque)
Optional per-message delivery callback (triggered by poll() or flush()) when a message has been succe...
rd_kafka_t * getProducer(void)
Get the Kafka producer's instance.
~KafkaManager(void)
Destroy the KafkaManager object.
rd_kafka_conf_t * configuration
Kafka's configuration.
void loadConfigurationGroup(rd_kafka_conf_t *conf, GKeyFile *key_file, const char *group)
Loads the configuration from Kafka's configuration file.
rd_kafka_t * producer
Kafka producer's instance.
rd_kafka_conf_t * getConfiguration(void)
Get the Kafka's configuration.
void setConfiguration(rd_kafka_conf_t *configuration)
Set the Kafka's configuration.
void setProducer(rd_kafka_t *producer)
Set the Kafka producer's instance.