From d19f767cb1af11cdb20513fda7c34f8c4b796d3d Mon Sep 17 00:00:00 2001 From: Brusk Awat Date: Thu, 1 Dec 2022 18:44:28 +0300 Subject: [PATCH] Fixes bug --- lib/rabbit_carrots/tasks/rmq.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rabbit_carrots/tasks/rmq.rake b/lib/rabbit_carrots/tasks/rmq.rake index 55519c9..e2fd008 100644 --- a/lib/rabbit_carrots/tasks/rmq.rake +++ b/lib/rabbit_carrots/tasks/rmq.rake @@ -5,7 +5,7 @@ namespace :rmq do task subscriber: :environment do Rails.application.eager_load! - channels = RabbitCarrots::Configuration.routing_key_mappings.map do |mapping| + channels = RabbitCarrots.configuration.routing_key_mappings.map do |mapping| # This will be supplied in initializer. At that time, the Handler will not be available to be loaded and will throw Uninitialized Constant { **mapping, handler_class: mapping[:handler_class].constantize } end @@ -30,7 +30,7 @@ end def run_task(queue_name:, handler_class:, routing_keys:) RabbitConnection.instance.channel.with do |channel| - exchange = channel.topic(RabbitCarrots::Configuration.event_bus_exchange_name, durable: true) + exchange = channel.topic(RabbitCarrots.configuration.event_bus_exchange_name, durable: true) Rails.logger.info "Listening on QUEUE: #{queue_name} for ROUTING KEYS: #{routing_keys}" queue = channel.queue(queue_name, durable: true)