protected override Task ExecuteAsync(CancellationToken stoppingToken) { logger.LogInformation("Consumer starting..."); stoppingToken.ThrowIfCancellationRequested(); rabbitManager.InitExchange(rabbitConfig.BaseExchangeName); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.MeetingQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.MeetingQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.PresentMembersQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.PresentMembersQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.VotingStartQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.VotingStartQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.VotingEndQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.VotingEndQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.ClearVotingResultQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.ClearVotingResultQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.VotingReviewQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.VotingReviewQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.StopwatchQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.StopwatchQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.NotificationQueueName, $"{rabbitConfig.MeetingRoom}.{rabbitConfig.NotificationQueueName}"); rabbitManager.JoinToExchange(rabbitConfig.BaseExchangeName, rabbitConfig.SystemTimeQueueName, $"{rabbitConfig.SystemTimeQueueName}"); rabbitManager.QueuePurge(rabbitConfig.MeetingQueueName); rabbitManager.QueuePurge(rabbitConfig.PresentMembersQueueName); rabbitManager.QueuePurge(rabbitConfig.VotingStartQueueName); rabbitManager.QueuePurge(rabbitConfig.VotingEndQueueName); rabbitManager.QueuePurge(rabbitConfig.ClearVotingResultQueueName); rabbitManager.QueuePurge(rabbitConfig.VotingReviewQueueName); rabbitManager.QueuePurge(rabbitConfig.StopwatchQueueName); rabbitManager.QueuePurge(rabbitConfig.NotificationQueueName); rabbitManager.QueuePurge(rabbitConfig.SystemTimeQueueName); rabbitManager.Consume(rabbitConfig.MeetingQueueName, stoppingToken, MeetingConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.PresentMembersQueueName, stoppingToken, PresentMembersConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.VotingStartQueueName, stoppingToken, VotingStartConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.VotingEndQueueName, stoppingToken, VotingEndConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.ClearVotingResultQueueName, stoppingToken, ClearVotingResultConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.VotingReviewQueueName, stoppingToken, VotingReviewConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.StopwatchQueueName, stoppingToken, StopwatchConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.NotificationQueueName, stoppingToken, NotificationConsumerReceivedAsync); rabbitManager.Consume(rabbitConfig.SystemTimeQueueName, stoppingToken, SystemTimeConsumerReceivedAsync); logger.LogInformation("Consumer started..."); return(Task.CompletedTask); }