Esempio n. 1
0
        private async Task QueueListener_ResponseReceived(object sender, RawResponseReceivedEventArgs e)
        {
            var iMessages = Counters.IncrementMessages();

            try
            {
                Counters.IncrementTotalReceivingBytes(e.MessageLength);
                Core.Log.InfoDetail("Response message received with CorrelationId = {0} . Current messages processing = {1}", e.CorrelationId, iMessages);
                if (ResponseReceived != null)
                {
                    await ResponseReceived.InvokeAsync(sender, e).ConfigureAwait(false);
                }
                if (MQueueRawServerEvents.ResponseReceived != null)
                {
                    await MQueueRawServerEvents.ResponseReceived.InvokeAsync(sender, e).ConfigureAwait(false);
                }
                Counters.DecrementMessages();
                Counters.IncrementTotalMessagesProccesed();
            }
            catch (Exception)
            {
                Counters.IncrementTotalExceptions();
                Counters.DecrementMessages();
                throw;
            }
        }
Esempio n. 2
0
 protected Task OnResponseReceivedAsync(RawResponseReceivedEventArgs responseReceived)
 => ResponseReceived?.InvokeAsync(this, responseReceived) ?? Task.CompletedTask;