DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ERSPublisher.hpp
Go to the documentation of this file.
1
10
11#ifndef ERSKAFKA_INCLUDE_ERSKAFKA_ERSPUBLISHER_HPP_
12#define ERSKAFKA_INCLUDE_ERSKAFKA_ERSPUBLISHER_HPP_
13
14#include "nlohmann/json.hpp"
15
16#include <librdkafka/rdkafkacpp.h>
17
18#include <memory>
19#include <string>
20
21#include "ers/Schema.hpp"
22
23namespace dunedaq {
24
25namespace erskafka {
26
28{
29
30public:
31 ERSPublisher(const nlohmann::json& conf);
32
33 ERSPublisher() = delete;
34 ERSPublisher(const ERSPublisher&) = delete;
38
40
42 // template<class Iterator>
43 // bool publish( Iterator begin, Iterator end) const;
44
45protected:
46 std::string topic(const dunedaq::ersschema::IssueChain&) const { return m_default_topic; }
47
48 std::string key(const dunedaq::ersschema::IssueChain& i) const { return i.session(); }
49
50private:
51 std::unique_ptr<RdKafka::Producer> m_producer;
52 std::string m_default_topic = "monitoring.ers_stream";
53};
54} // erskafka namespace
55} // dunedaq namespace
56
57#endif // ERSKAFKA_INCLUDE_ERSKAFKA_ERSPUBLISHER_HPP_
bool publish(dunedaq::ersschema::IssueChain &&) const
ERSPublisher & operator=(const ERSPublisher &)=delete
ERSPublisher & operator=(ERSPublisher &&)=delete
std::unique_ptr< RdKafka::Producer > m_producer
ERSPublisher(const ERSPublisher &)=delete
ERSPublisher(const nlohmann::json &conf)
ERSPublisher(ERSPublisher &&)=delete
std::string key(const dunedaq::ersschema::IssueChain &i) const
std::string topic(const dunedaq::ersschema::IssueChain &) const
const std::string & session() const
Definition issue.pb.h:1966
The DUNE-DAQ namespace.