public async Task Handle(IList <RequiredPaymentEventModel> models, CancellationToken cancellationToken) { await storageService.StoreRequiredPayments(models.ToList(), cancellationToken).ConfigureAwait(false); var jobStatusClient = factory.Create(); foreach (var model in models) { await jobStatusClient.ProcessedJobMessage(model.JobId, model.EventId, model.GetType().Name, new List <GeneratedMessage>()); } }
public override async Task Invoke(IIncomingLogicalMessageContext context, Func <Task> next) { var generatedMessages = new List <GeneratedMessage>(); context.Extensions.Set(JobStatusBehaviourConstants.GeneratedMessagesKey, generatedMessages); await next().ConfigureAwait(false); if (context.Message.Instance is IMonitoredMessage paymentMessage) { var jobStatusClient = factory.Create(); await jobStatusClient.ProcessedJobMessage(paymentMessage.JobId, context.GetMessageId(), context.GetMessageName(), generatedMessages); } }
public async Task Handle(IList <CalculatedRequiredLevyAmount> messages, CancellationToken cancellationToken) { logger.LogInfo($"Received {messages.Count} messages"); await levyTransactionBatchStorageService.StoreLevyTransactions(messages, cancellationToken) .ConfigureAwait(false); var monitoringClient = monitoringClientFactory.Create(); foreach (var calculatedRequiredLevyAmount in messages) { await monitoringClient.ProcessedJobMessage(calculatedRequiredLevyAmount.JobId, calculatedRequiredLevyAmount.EventId, calculatedRequiredLevyAmount.GetType().ToString(), new List <GeneratedMessage>() ); } }