From 69b7ec69112e11c3128da7220f9f04b3d7cf1bcf Mon Sep 17 00:00:00 2001 From: Reid Sunderland Date: Tue, 1 Oct 2024 14:31:01 +0000 Subject: [PATCH] QoS should be called by all instances, not just the lead. It's a per-channel/connection setting, not per-queue --- sarracenia/moth/amqp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sarracenia/moth/amqp.py b/sarracenia/moth/amqp.py index 89b633705..69049a85f 100755 --- a/sarracenia/moth/amqp.py +++ b/sarracenia/moth/amqp.py @@ -340,6 +340,10 @@ def getSetup(self) -> None: if not self.__connect(self.o['broker']): logger.critical('could not connect') break + + if self.o['prefetch'] != 0: + # using global False because RabbitMQ Quorum Queues don't support Global QoS, issue #1233 + self.channel.basic_qos(0, self.o['prefetch'], False) # only first/lead instance needs to declare a queue and bindings. if 'no' in self.o and self.o['no'] >= 2: @@ -348,10 +352,6 @@ def getSetup(self) -> None: #logger.info('getSetup connected to {}'.format(self.o['broker'].url.hostname) ) - if self.o['prefetch'] != 0: - # using global False because RabbitMQ Quorum Queues don't support Global QoS, issue #1233 - self.channel.basic_qos(0, self.o['prefetch'], False) - #FIXME: test self.first_setup and props['reset']... delete queue... broker_str = self.o['broker'].url.geturl().replace( ':' + self.o['broker'].url.password + '@', '@')