public async Task Consume(ConsumeContext <SearchRequestOrdered> context)
 {
     using (LogContext.PushProperty("RequestRef", $"{context.Message?.Person?.Agency?.RequestId}"))
         using (LogContext.PushProperty("AgencyCode", $"{context.Message?.Person?.Agency?.Code}"))
         {
             _logger.LogInformation("get the searchRequestOrdered message.");
             var cts = new CancellationTokenSource();
             await _searchRequestNotifier.NotifySearchRequestEventAsync(context.Message.RequestId, context.Message, cts.Token);
         }
 }
예제 #2
0
 public async Task Consume(ConsumeContext <SearchRequestOrdered> context)
 {
     using (LogContext.PushProperty("RequestRef", $"{context.Message?.Person?.Agency?.RequestId}"))
         using (LogContext.PushProperty("AgencyCode", $"{context.Message?.Person?.Agency?.Code}"))
         {
             try
             {
                 _logger.LogInformation("get the searchRequestOrdered message.");
                 await _searchRequestNotifier.NotifySearchRequestEventAsync(context.Message.RequestId, context.Message, CancellationToken.None, context.GetRetryAttempt(), _retryConfig.Value.RetryTimes);
             }
             catch (Exception e)
             {
                 _logger.LogError(e, "SearchRequestOrdered {requestRef} is put into error queue.", context.Message?.RequestId);
                 throw;
             }
         }
 }
 public async Task Consume(ConsumeContext <NotificationAcknowledged> context)
 {
     using (LogContext.PushProperty("RequestRef", $"{context.Message?.RequestId}"))
         using (LogContext.PushProperty("AgencyCode", $"{context.Message?.ProviderProfile?.Name}"))
         {
             try
             {
                 _logger.LogInformation("get the NotificationAcknowledged message.");
                 var cts = new CancellationTokenSource();
                 await _searchRequestNotifier.NotifySearchRequestEventAsync(context.Message.RequestId, context.Message, cts.Token, context.GetRetryAttempt(), _retryConfig.Value.RetryTimes);
             }catch (Exception e)
             {
                 _logger.LogError(e, "NotificationAcknowledged {requestRef} is put into error queue.", context.Message?.RequestId);
                 throw;
             }
         }
 }