Skip to content

Commit

Permalink
QoS should be called by all instances, not just the lead. It's a per-…
Browse files Browse the repository at this point in the history
…channel/connection setting, not per-queue
  • Loading branch information
reidsunderland committed Oct 1, 2024
1 parent 1ebc35a commit 69b7ec6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sarracenia/moth/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 + '@', '@')
Expand Down

0 comments on commit 69b7ec6

Please sign in to comment.