Class StatKafkaMessageSender

Class Documentation

class StatKafkaMessageSender

Sends a particular message type and topic to Kafka.

Public Functions

StatKafkaMessageSender(std::string topic, std::shared_ptr<StatKafkaProducer> producer, std::shared_ptr<StatKafkaMsgGenerator> generator)

Construct a new Stat Kafka Message Sender object.

Parameters
  • topic – the topic to which messages will be sent

  • producer – the Kafka publisher used to send messages

  • generator – the generator used to create the message payload

void send_stats(const StatStorage &storage)

Send a stat message to Kafka.

Parameters

storage – the computed statistics from which to generate the message

inline const std::string &get_topic()

Get the topic that the sender is configured with.

Returns

the topic that the sender is configured with.

inline const std::shared_ptr<StatKafkaMsgGenerator> &get_generator()

Get the message generator that the sender is configured with.

Returns

the message generator that the sender is configured with.