From c9e424c7153d8246edc7f1beef0ec70fdc900fa9 Mon Sep 17 00:00:00 2001 From: PaulKBaumann Date: Fri, 2 Aug 2024 16:51:00 -0400 Subject: [PATCH 1/2] Update hoppy properties to allow additional arguments --- shared/lib-hoppy/hoppy/__init__.py | 2 +- shared/lib-hoppy/hoppy/base_queue_declarer.py | 9 +++++++-- shared/lib-hoppy/hoppy/hoppy_properties.py | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/shared/lib-hoppy/hoppy/__init__.py b/shared/lib-hoppy/hoppy/__init__.py index 5becc17c04..5c4105cd39 100644 --- a/shared/lib-hoppy/hoppy/__init__.py +++ b/shared/lib-hoppy/hoppy/__init__.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "1.0.1" diff --git a/shared/lib-hoppy/hoppy/base_queue_declarer.py b/shared/lib-hoppy/hoppy/base_queue_declarer.py index 9986016736..7f48ea43ab 100644 --- a/shared/lib-hoppy/hoppy/base_queue_declarer.py +++ b/shared/lib-hoppy/hoppy/base_queue_declarer.py @@ -19,6 +19,7 @@ def _set_queue_properties(self, queue_properties: QueueProperties): self.durable_queue = queue_properties.durable self.auto_delete_queue = queue_properties.auto_delete self.exclusive_queue = queue_properties.exclusive + self.arguments = queue_properties.arguments def _on_exchange_declare_ok(self, _unused_frame): super()._on_exchange_declare_ok(_unused_frame) @@ -30,12 +31,14 @@ def _setup_queue(self): passive_declare=self.passive_declare_queue, durable=self.durable_queue, exclusive=self.exclusive_queue, - auto_delete=self.auto_delete_exchange) + auto_delete=self.auto_delete_exchange, + arguments=self.arguments) self._channel.queue_declare(queue=self.queue_name, passive=self.passive_declare_queue, durable=self.durable_queue, exclusive=self.exclusive_queue, auto_delete=self.auto_delete_queue, + arguments=self.arguments, callback=self._on_queue_declare_ok) def _on_queue_declare_ok(self, _unused_frame): @@ -44,7 +47,9 @@ def _on_queue_declare_ok(self, _unused_frame): passive_declare=self.passive_declare_queue, durable=self.durable_queue, exclusive=self.exclusive_queue, - auto_delete=self.auto_delete_exchange) + auto_delete=self.auto_delete_exchange, + dead_letter_queue=self.dead_letter_queue, + dead_letter_exchange=self.dead_letter_exchange) self._debug('bindingQueue', queue=self.queue_name, exchange=self.exchange_name, diff --git a/shared/lib-hoppy/hoppy/hoppy_properties.py b/shared/lib-hoppy/hoppy/hoppy_properties.py index bef31a53ef..c7eb9b1f9e 100644 --- a/shared/lib-hoppy/hoppy/hoppy_properties.py +++ b/shared/lib-hoppy/hoppy/hoppy_properties.py @@ -1,5 +1,5 @@ from dataclasses import dataclass - +from dataclasses import field @dataclass class ExchangeProperties: @@ -17,3 +17,4 @@ class QueueProperties: durable: bool = True auto_delete: bool = True exclusive: bool = False + arguments: dict = field(default_factory=dict) From 96298c3140f1525bc8ddb12ba8e6decd156dd70d Mon Sep 17 00:00:00 2001 From: PaulKBaumann Date: Mon, 5 Aug 2024 11:34:05 -0400 Subject: [PATCH 2/2] Update shared/lib-hoppy/hoppy/base_queue_declarer.py Co-authored-by: Sam Raudabaugh --- shared/lib-hoppy/hoppy/base_queue_declarer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared/lib-hoppy/hoppy/base_queue_declarer.py b/shared/lib-hoppy/hoppy/base_queue_declarer.py index 7f48ea43ab..76d7a0afa2 100644 --- a/shared/lib-hoppy/hoppy/base_queue_declarer.py +++ b/shared/lib-hoppy/hoppy/base_queue_declarer.py @@ -48,8 +48,7 @@ def _on_queue_declare_ok(self, _unused_frame): durable=self.durable_queue, exclusive=self.exclusive_queue, auto_delete=self.auto_delete_exchange, - dead_letter_queue=self.dead_letter_queue, - dead_letter_exchange=self.dead_letter_exchange) + arguments=self.arguments) self._debug('bindingQueue', queue=self.queue_name, exchange=self.exchange_name,