Example #1
0
 private void _consumer_CandlesReceived(object sender, CandlesReceivedEventArgs e)
 {
     _logger.LogInformation("Example Consumer Dummy Service received {TickCount} ticks for {MarketFeedSetting}. {@CandlesReceivedEventArgs}",
                            e.TimeSeries.TickCount,
                            e.MarketFeedSettings,
                            e);
 }
        public void Send(CandlesReceivedEventArgs message)
        {
            if (_isConnected)
            {
                _channel.BasicPublish(_channelConfig.ExchangeName,
                                      _channelConfig.RoutingKey,
                                      false,
                                      _props,
                                      Encoding.UTF8.GetBytes(_jsonUtil.SerializeObject(message)));

                _logger.LogTrace("Message sent on channel {ChannelNumber}", _channel.ChannelNumber);
            }
            else
            {
                _logger.LogError("Attempt to send {Message} when Client not connected.", message);
            }
        }
 public void Send(CandlesReceivedEventArgs e)
 {
     CandlesReceived?.Invoke(this, e);
 }