diff --git a/src/lib/amqp/sarra-canada-amqp.js b/src/lib/amqp/sarra-canada-amqp.js index eb5283d0..34769403 100644 --- a/src/lib/amqp/sarra-canada-amqp.js +++ b/src/lib/amqp/sarra-canada-amqp.js @@ -17,7 +17,7 @@ export function listen(options) { let amqp_port = 5671; let amqp_user = "anonymous"; let amqp_password = "anonymous"; - let amqp_subtopic = "#"; + let amqp_subtopic = "*.WXO-DD.#"; let amqp_queue = null; let amqp_expires = 10800000; // three hours in milliseconds let amqp_reconnect_limit_ms = 120000; diff --git a/src/lib/eccc/alertMonitor.ts b/src/lib/eccc/alertMonitor.ts index c640a0a9..723fbc2c 100644 --- a/src/lib/eccc/alertMonitor.ts +++ b/src/lib/eccc/alertMonitor.ts @@ -31,7 +31,7 @@ class AlertMonitor { // hook up the amqp listener const { connection, emitter: listener } = listen({ - amqp_subtopic: `alerts.cap.#`, + amqp_subtopic: `*.WXO-DD.alerts.cap.#`, }); // handle errors and messages diff --git a/src/lib/eccc/conditions.ts b/src/lib/eccc/conditions.ts index 806ba8fa..02db617c 100644 --- a/src/lib/eccc/conditions.ts +++ b/src/lib/eccc/conditions.ts @@ -92,7 +92,7 @@ class CurrentConditions { // hook up the amqp listener const { connection, emitter: listener } = listen({ - amqp_subtopic: `citypage_weather.xml.${config.primaryLocation.province}.#`, + amqp_subtopic: `*.WXO-DD.citypage_weather.xml.${config.primaryLocation.province}.#`, }); // handle errors and messages @@ -102,7 +102,7 @@ class CurrentConditions { // make sure its relevant to us if (!url.includes(`${this._weatherStationID}_e.xml`)) return; - this.fetchConditions(); + this.fetchConditions(url); logger.log("Received new conditions from AMQP at", date); }); @@ -112,9 +112,9 @@ class CurrentConditions { logger.log("Started AMQP conditions listener"); } - private fetchConditions() { + private fetchConditions(url: string = this._apiUrl) { axios - .get(this._apiUrl) + .get(url) .then((resp) => { // parse to weather object const weather = new Weather(resp.data);