|
|
|
@ -58,7 +58,13 @@ namespace Myshipping.Core.MQ
|
|
|
|
|
|
|
|
|
|
ConnectionFactory factory = new ConnectionFactory();
|
|
|
|
|
var repoSysCfg = _serviceScope.ServiceProvider.GetService<SqlSugarRepository<SysConfig>>();
|
|
|
|
|
var mqUrl = repoSysCfg.FirstOrDefault(x => x.Code == "CompanyUserChangeMqUrl").Value;
|
|
|
|
|
var mqUrl = repoSysCfg.FirstOrDefault(x => x.Code == "CompanyUserChangeMqUrl")?.Value;
|
|
|
|
|
if (string.IsNullOrEmpty(mqUrl))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"接收公司、员工变动消息推送所需MQUrl未配置");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"准备连接公司用户同步消息队列:{mqUrl}");
|
|
|
|
|
factory.Uri = new Uri(mqUrl);
|
|
|
|
|
mqConn = factory.CreateConnection("客户订舱平台客户端");
|
|
|
|
@ -71,8 +77,7 @@ namespace Myshipping.Core.MQ
|
|
|
|
|
var consumer = new EventingBasicConsumer(model);
|
|
|
|
|
consumer.Received += Consumer_Received;
|
|
|
|
|
model.BasicConsume(QueueName, true, consumer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|