From 834c8bc178b34506c70fa237f76d054353e10362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Neto?= Date: Wed, 24 Jan 2024 15:55:36 -0400 Subject: [PATCH] Vinculando a fila ao exchange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Até então a fila de processamento não era especificada, ficando a cargo do RabbitMQ a escolha da mesma. Agora forçamos a fila que deve ser utilizada. Isso permite configurar diferentes filas para diferentes fins. --- src/app/Handlers/RabbitMQHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/Handlers/RabbitMQHandler.php b/src/app/Handlers/RabbitMQHandler.php index 922cabb..ec51f32 100644 --- a/src/app/Handlers/RabbitMQHandler.php +++ b/src/app/Handlers/RabbitMQHandler.php @@ -47,6 +47,10 @@ class RabbitMQHandler extends AbstractProcessingHandler $this->exchange = $exchange; $this->routingKey = $routingKey; $this->channel->exchange_declare($exchange, 'direct', false, true, false); + + $queueName = config('logging.channels.rabbitmq.queue', 'logstash_queue'); + $this->channel->queue_declare($queueName, false, true, false, false); + $this->channel->queue_bind($queueName, $this->exchange, $this->routingKey); } /**