DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ERSPublisher.hpp
Go to the documentation of this file.
1
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
25
26 namespace erskafka {
27
29
30 public:
31
32 ERSPublisher(const nlohmann::json& conf);
33
34 ERSPublisher() = delete;
35 ERSPublisher(const ERSPublisher & ) = delete;
39
41
43 // template<class Iterator>
44 // bool publish( Iterator begin, Iterator end) const;
45
46 protected:
47 std::string topic( const dunedaq::ersschema::IssueChain & ) const {
48 return m_default_topic;
49 }
50
51 std::string key( const dunedaq::ersschema::IssueChain & i ) const {
52 return i.session() ;
53 }
54
55 private:
56
57 std::unique_ptr<RdKafka::Producer> m_producer;
58 std::string m_default_topic = "monitoring.ers_stream";
59
60 };
61} // erskafka namespace
62} // dunedaq namespace
63
64#endif //ERSKAFKA_INCLUDE_ERSKAFKA_ERSPUBLISHER_HPP_
bool publish(dunedaq::ersschema::IssueChain &&) const
ERSPublisher & operator=(const 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
Including Qt Headers.