public void Start() { _log.LogInformation("PingResponder Starting."); try { _log.LogInformation("Opening connection to RabbitMQ host."); _cn = _cf.OpenConnection(); _ch = _cn.GetChannel(); _ml = _ch.BindPrivateQueue(OnMessage, new[] { PBXConnectorTopics.PbxPingRequest }); _ml.Start(); } //Catching generic exception to not load dependencies from Messaging catch (Exception ex) { _log.LogError($"Failed to connect to RabbitMQ broker at [{_cf.Hostname}] with error [{ex.Message}]"); throw; } }
protected void StartRabbitMQ() { CN = CF.OpenConnection(); CH = CN.GetChannel(); }