Renames event_bus_exchange_name to rabbitmq_exchange_name for consistency

This commit is contained in:
Muhammad Nawzad 2023-12-06 14:26:16 +03:00
parent 6b6da5e5cb
commit 7c4c7ea08f
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2
3 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ RabbitCarrots.configure do |c|
c.rabbitmq_user = ENV.fetch('RABBITMQ__USER', nil)
c.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD', nil)
c.rabbitmq_vhost = ENV.fetch('RABBITMQ__VHOST', nil)
c.event_bus_exchange_name = ENV.fetch('EVENTBUS__EXCHANGE_NAME', nil)
c.rabbitmq_exchange_name = ENV.fetch('RABBITMQ__EXCHANGE_NAME', nil)
c.routing_key_mappings = [
{ routing_keys: ['RK1', 'RK2'], queue: 'QUEUE_NAME', handler: 'CLASS HANDLER IN STRING' },
{ routing_keys: ['RK1', 'RK2'], queue: 'QUEUE_NAME', handler: 'CLASS HANDLER IN STRING' }

View File

@ -9,6 +9,6 @@ module RabbitCarrots
end
class Configuration
attr_accessor :rabbitmq_host, :rabbitmq_port, :rabbitmq_user, :rabbitmq_password, :rabbitmq_vhost, :routing_key_mappings, :event_bus_exchange_name
attr_accessor :rabbitmq_host, :rabbitmq_port, :rabbitmq_user, :rabbitmq_password, :rabbitmq_vhost, :routing_key_mappings, :rabbitmq_exchange_name
end
end

View File

@ -36,7 +36,7 @@ end
def run_task(queue_name:, handler_class:, routing_keys:, queue_arguments: {})
RabbitCarrots::Connection.instance.channel.with do |channel|
exchange = channel.topic(RabbitCarrots.configuration.event_bus_exchange_name, durable: true)
exchange = channel.topic(RabbitCarrots.configuration.rabbitmq_exchange_name, durable: true)
Rails.logger.info "Listening on QUEUE: #{queue_name} for ROUTING KEYS: #{routing_keys}"
queue = channel.queue(queue_name, durable: true, arguments: queue_arguments)