Add exchange_name parameter to run_task method for enhanced configuration flexibility

This commit is contained in:
Ari Karim 2026-01-18 10:08:27 +03:00
parent dd329804ae
commit 274bec3e68
No known key found for this signature in database
GPG Key ID: 1A5559E2E32F1805

View File

@ -77,7 +77,7 @@ module RabbitCarrots
@running = false @running = false
end end
def run_task(queue_name:, handler_class:, routing_keys:, queue_arguments: {}, kill_to_restart_on_standard_error: false) def run_task(queue_name:, handler_class:, routing_keys:, queue_arguments: {}, exchange_name: nil, kill_to_restart_on_standard_error: false)
RabbitCarrots::Connection.instance.channel.with do |channel| RabbitCarrots::Connection.instance.channel.with do |channel|
exchange = channel.topic(exchange_name || RabbitCarrots.configuration.rabbitmq_exchange_name, durable: true) exchange = channel.topic(exchange_name || RabbitCarrots.configuration.rabbitmq_exchange_name, durable: true)