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-01-12 12:22:55 +0100
commit7b3968d9b012e873a9b393fcefa578c46fca18c6 (patch)
treee2ed375f0a9ae5da64417b2375b23c00f3bebd49 /oslo_messaging/_drivers/amqpdriver.py
parent1db6de63a86812742cbc37a0f5fe1fd7a095dd7f (diff)
downloadoslo-messaging-7b3968d9b012e873a9b393fcefa578c46fca18c6.tar.gz
[rabbit] use retry parameters during notification sending
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
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 24fdbc7..991bf46 100644
--- a/oslo_messaging/_drivers/amqpdriver.py
+++ b/oslo_messaging/_drivers/amqpdriver.py
@@ -601,9 +601,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:
@@ -649,7 +650,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'"