mirror of
https://github.com/ditkrg/rabbit_carrots.git
synced 2026-01-22 22:06:40 +00:00
Fixes bug
This commit is contained in:
parent
77b6151364
commit
d19f767cb1
@ -5,7 +5,7 @@ namespace :rmq do
|
|||||||
task subscriber: :environment do
|
task subscriber: :environment do
|
||||||
Rails.application.eager_load!
|
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
|
# 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 }
|
{ **mapping, handler_class: mapping[:handler_class].constantize }
|
||||||
end
|
end
|
||||||
@ -30,7 +30,7 @@ end
|
|||||||
|
|
||||||
def run_task(queue_name:, handler_class:, routing_keys:)
|
def run_task(queue_name:, handler_class:, routing_keys:)
|
||||||
RabbitConnection.instance.channel.with do |channel|
|
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}"
|
Rails.logger.info "Listening on QUEUE: #{queue_name} for ROUTING KEYS: #{routing_keys}"
|
||||||
queue = channel.queue(queue_name, durable: true)
|
queue = channel.queue(queue_name, durable: true)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user