TemplateMQSyncer вернул как был, без использования IMqService

This commit is contained in:
Mikhail Trubnikov
2023-09-22 09:43:56 +10:00
parent f42c8b014e
commit 332dc95f9e
5 changed files with 99 additions and 12 deletions

View File

@@ -91,7 +91,7 @@ namespace PARR.BLL.Services.Implementations
}
public void InitConsumer(IMqSettings mqSettings)
public bool InitConsumer(IMqSettings mqSettings)
{
logger.LogInformation($"Устанавливаю соединение с RabbitMQ: {mqSettings.HostName}, {mqSettings.QueueName}");
@@ -140,10 +140,14 @@ namespace PARR.BLL.Services.Implementations
channel.BasicConsume(mqSettings.QueueName, false, consumer);
return true;
}
catch (Exception ex)
{
logger.LogError(ex, $"Ошибка при получении сообщений из очереди: {mqSettings.HostName}, {mqSettings.QueueName}");
return false;
}
}