12#ifndef KAFKAOPMON_INCLUDE_KAFKAOPMON_OPMONPUBLISHER_HPP_
13#define KAFKAOPMON_INCLUDE_KAFKAOPMON_OPMONPUBLISHER_HPP_
15#include <librdkafka/rdkafkacpp.h>
16#include <nlohmann/json.hpp>
29 "No " << parameter <<
" in " << conf,
30 ((std::string)parameter)((std::string)conf)
35 "Invalid " << parameter <<
", cause: " << reason,
36 ((std::string)parameter)((std::string)reason)
40 FailedProducerCreation,
41 "Failed creation of a Kafka producer, cause: " << reason,
47 "Failed produce of message with key " << key <<
", cause: " << reason,
48 ((std::string)key)((std::string)reason)
52 TimeoutReachedWhileFlushing,
53 "Publisher destroyed before all messages were completed, timeout: " << timeout <<
" ms",
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
std::unique_ptr< RdKafka::Producer > m_producer
OpMonPublisher & operator=(const OpMonPublisher &)=delete
std::string extract_key(const dunedaq::opmon::OpMonEntry &e) const noexcept
OpMonPublisher(const OpMonPublisher &)=delete
std::string extract_topic(const dunedaq::opmon::OpMonEntry &) const noexcept
OpMonPublisher(const nlohmann::json &conf)
OpMonPublisher(OpMonPublisher &&)=delete
void publish(dunedaq::opmon::OpMonEntry &&) const
std::string m_default_topic
std::string to_string(const dunedaq::opmon::OpMonId &)