private static void OnTickArrived(Tick tick) { byte[] responseBytes = System.Text.Encoding.UTF8.GetBytes(tick.ToString()); _channelTransmit.BasicPublish("md-exchange", _props.ReplyTo, _replyProps, responseBytes); //_channelTransmit.BasicAck(_ea.DeliveryTag, false); }
/// <summary> /// Generates the Tick data required by the subscriber /// </summary> private void GenerateData(object sender, ElapsedEventArgs elapsedEventArgs) { try { if (_count > 0) { _sendDataTimer.Stop(); Console.WriteLine("Timer Stopped"); } _count++; GenerateBid(); GenerateAsk(); Tick tick = new Tick(_symbol, DateTime.UtcNow, _bid, _ask, 0.0m, _bidSize, _askSize, 0); if (TickArrived != null) { TickArrived(tick); } } catch (Exception exception) { Console.WriteLine("Exception occured while trying to generate synthetic data.", exception); } }