Example #1
0
        private void CancelConsumer()
        {
            if (_consumer != null)
            {
                if (_consumer.IsRunning)
                {
                    _consumer.OnCancel();
                }

                _consumer = null;
            }
        }
Example #2
0
        void CancelConsumer()
        {
            if (consumer != null)
            {
                if (consumer.IsRunning)
                {
                    consumer.OnCancel();
                    Channel.BasicCancel(consumer.ConsumerTag);
                }

                Logger.InfoFormat("RmqMessageConsumer: Cancelled consumer with ConsumerTag {0}", consumer.ConsumerTag);
                consumer = null;
            }
        }
Example #3
0
        /// <summary>
        /// Stop MQ Server
        /// </summary>
        public void Disconnect()
        {
            _tickconsumer.OnCancel();
            _tokenSource.Cancel();
            //_dataConsumerTask.Dispose();
            //_barTask.Dispose();

            _easyNetQBus.Dispose();
            _easyNetQBus = null;

            _rabbitMqTickChannel.QueueDelete("simulated.tickdata.queue");

            _rabbitMqTickChannel.Close();
            _rabbitMqTickConnection.Close();
            _rabbitMqTickBus = null;

            //_rabbitMqBarChannel.Close();
            //_rabbitMqBarConnection.Close();
        }
Example #4
0
 /// <summary>
 /// Called when [cancel].
 /// </summary>
 public void OnCancel()
 {
     _basicConsumer.OnCancel();
 }