public async Task RunAsync() { _logger.LogInformation($"Starting the Receiver AppService..."); await _massTransitService.StartAsync(CancellationToken.None); _logger.LogInformation($"Service Bus Started at {DateTime.UtcNow}"); _logger.LogInformation($"RunAsync Completed at {DateTime.UtcNow}"); }
public async Task RunAsync() { _logger.LogInformation($"Starting the AppService..."); await _massTransitService.StartAsync(CancellationToken.None); _logger.LogInformation($"Service Bus Started at {DateTime.UtcNow}"); //Sending Messages for (int i = 0; i < 15; i++) { _logger.LogInformation($"Sending Message {i + 1}"); await _messageSender.SendAsync(new SampleMessage($"Message {i + 1} was created at {DateTime.UtcNow}"), "SomeNewQueueXYZ"); Thread.Sleep(1000); } _logger.LogInformation($"RunAsync Completed at {DateTime.UtcNow}"); }