Esempio n. 1
0
        private void ConsumeMessage(object message, IBackplaneConsumer consumer)
        {
            var stopwatch = Stopwatch.StartNew();

            consumer.Consume(((dynamic)message).Data);

            stopwatch.Stop();

            _backplaneMetrics.RecordProcessedMessage(consumer.GetType().Name, stopwatch.Elapsed.TotalMilliseconds);
        }
Esempio n. 2
0
        private bool TryFindConsumer(Guid type, out IBackplaneConsumer consumer)
        {
            consumer = _container.GetAllInstances <IBackplaneConsumer>().FirstOrDefault(x => x.ConsumesType == type);

            return(consumer != null);
        }