示例#1
0
        private void OnSendTicketFailed(object sender, TicketSendFailedEventArgs e)
        {
            _log.Info($"Sending ticket '{e.TicketId}' failed.");
            var task = _ticketHandler.HandleFailureTimeout(e.TicketId);

            if (task != null)
            {
                task.Wait();
                task.Dispose();
            }
        }
示例#2
0
 private void PublisherOnTicketSendFailed(object sender, TicketSendFailedEventArgs ticketSendFailedEventArgs)
 {
     _executionLog.LogInformation($"Publish of ticket {ticketSendFailedEventArgs.TicketId} failed.");
     // first clean it from awaiting ticket response
     lock (_lockForTicketsForNonBlockingRequestsCache)
     {
         if (_ticketsForNonBlockingRequests.Contains(ticketSendFailedEventArgs.TicketId))
         {
             _ticketsForNonBlockingRequests.Remove(ticketSendFailedEventArgs.TicketId);
         }
     }
     SendTicketFailed?.Invoke(sender, ticketSendFailedEventArgs);
 }
示例#3
0
        private void PublisherChannelOnMqMessagePublishFailed(object sender, MessagePublishFailedEventArgs messagePublishFailedEventArgs)
        {
            _executionLog.Info($"Message publishing failed with correlationId: {messagePublishFailedEventArgs.CorrelationId}, errorMessage: {messagePublishFailedEventArgs.ErrorMessage}, routingKey: {messagePublishFailedEventArgs.RoutingKey}.");

            var ticketId = string.Empty;
            var ci       = _ticketCache.Values.FirstOrDefault(f => f.CorrelationId == messagePublishFailedEventArgs.CorrelationId);

            if (!string.IsNullOrEmpty(ci?.TicketId))
            {
                ticketId = ci.TicketId;
            }
            var json = Encoding.UTF8.GetString(messagePublishFailedEventArgs.RawData.ToArray());

            var arg = new TicketSendFailedEventArgs(ticketId, json, messagePublishFailedEventArgs.ErrorMessage);

            TicketSendFailed?.Invoke(sender, arg);
        }
示例#4
0
 private void OnSendTicketFailed(object sender, TicketSendFailedEventArgs e)
 {
     _log.LogInformation($"Sending ticket '{e.TicketId}' failed.");
 }