private void PerformActionsOnClientResponse(string apiMessage) { logger.LogInfo(apiMessage); var message = CreateMessage(apiMessage); producer.ProduceMessage(message); }
/// <summary> /// Publishes summary message (aggregated info about topic) every interval /// </summary> public void StartPublishingAggregatedEvents() { Task.Factory.StartNew(() => { while (true) { Thread.Sleep(_publishingIntervalInMiliseconds); if (_stopPublishing) { _messageProducer = null; return; } var producerMessage = GetSummaryMessage(); _messageProducer.ProduceMessage(producerMessage); } }); }