summaryrefslogtreecommitdiff
path: root/oslo_messaging/_drivers/amqpdriver.py
diff options
context:
space:
mode:
authorBalazs Gibizer <balazs.gibizer@est.tech>2021-11-23 16:58:05 +0100
committerBalazs Gibizer <balazs.gibizer@est.tech>2022-02-11 13:20:12 +0100
commit5d6fd1a176a47ffdc55223b990c466917ded9449 (patch)
tree76371196865940cccca3a7a315bd1c91317af63d /oslo_messaging/_drivers/amqpdriver.py
parentd63173a31f500254277641a76bb721a8bf07ad9c (diff)
downloadoslo-messaging-stable/wallaby.tar.gz
[rabbit] use retry parameters during notification sendingwallaby-em12.7.3stable/wallaby
The rabbit backend now applies the [oslo_messaging_notifications]retry, [oslo_messaging_rabbit]rabbit_retry_interval, rabbit_retry_backoff and rabbit_interval_max configuration parameters when tries to establish the connection to the message bus during notification sending. This patch also clarifies the differences between the behavior of the kafka and the rabbit drivers in this regard. Closes-Bug: #1917645 Change-Id: Id4ccafc95314c86ae918336e42cca64a6acd4d94 (cherry picked from commit 7b3968d9b012e873a9b393fcefa578c46fca18c6) (cherry picked from commit 3b5a0543e97619ca8f8cf98193f6b6375d77cbf2)
Diffstat (limited to 'oslo_messaging/_drivers/amqpdriver.py')
-rw-r--r--oslo_messaging/_drivers/amqpdriver.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/oslo_messaging/_drivers/amqpdriver.py b/oslo_messaging/_drivers/amqpdriver.py
index cdc21c5..6dc4f0f 100644
--- a/oslo_messaging/_drivers/amqpdriver.py
+++ b/oslo_messaging/_drivers/amqpdriver.py
@@ -593,9 +593,10 @@ class AMQPDriverBase(base.BaseDriver):
def _get_exchange(self, target):
return target.exchange or self._default_exchange
- def _get_connection(self, purpose=rpc_common.PURPOSE_SEND):
+ def _get_connection(self, purpose=rpc_common.PURPOSE_SEND, retry=None):
return rpc_common.ConnectionContext(self._connection_pool,
- purpose=purpose)
+ purpose=purpose,
+ retry=retry)
def _get_reply_q(self):
with self._reply_q_lock:
@@ -641,7 +642,7 @@ class AMQPDriverBase(base.BaseDriver):
log_msg = "CAST unique_id: %s " % unique_id
try:
- with self._get_connection(rpc_common.PURPOSE_SEND) as conn:
+ with self._get_connection(rpc_common.PURPOSE_SEND, retry) as conn:
if notify:
exchange = self._get_exchange(target)
LOG.debug(log_msg + "NOTIFY exchange '%(exchange)s'"