예제 #1
0
        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}");
        }
예제 #2
0
        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}");
        }