[AMQP 1.0] Add configuration parameters for send message deadline
This patch add driver configuration option parameters for oslo_messaging_amqp reply, send and notification timeout. These timeouts are used when the caller does not provide a timeout expiry. Change-Id: I398a4686abf3df6e5c802d94d6bda7ba9995833d Depends-On: I6b60b6944a4c44da9b2e41ab2a83ab59f15e396e Closes-Bug: #1596641
This commit is contained in:
parent
4c0674d194
commit
ded89418a2
|
@ -103,7 +103,7 @@ amqp1_opts = [
|
|||
help='Maximum limit for connection_retry_interval'
|
||||
' + connection_retry_backoff'),
|
||||
|
||||
# Message send retry options
|
||||
# Message send retry and timeout options
|
||||
|
||||
cfg.IntOpt('max_send_retries',
|
||||
default=0,
|
||||
|
@ -118,6 +118,24 @@ amqp1_opts = [
|
|||
help='Time to pause between re-connecting an AMQP 1.0 link that'
|
||||
' failed due to a recoverable error.'),
|
||||
|
||||
cfg.IntOpt('default_reply_timeout',
|
||||
default=30,
|
||||
min=5,
|
||||
help='The deadline for an rpc reply message delivery.'
|
||||
' Only used when caller does not provide a timeout expiry.'),
|
||||
|
||||
cfg.IntOpt('default_send_timeout',
|
||||
default=60,
|
||||
min=5,
|
||||
help='The deadline for an rpc cast or call message delivery.'
|
||||
' Only used when caller does not provide a timeout expiry.'),
|
||||
|
||||
cfg.IntOpt('default_notify_timeout',
|
||||
default=60,
|
||||
min=5,
|
||||
help='The deadline for a sent notification message delivery.'
|
||||
' Only used when caller does not provide a timeout expiry.'),
|
||||
|
||||
# Addressing:
|
||||
|
||||
cfg.StrOpt('addressing_mode',
|
||||
|
|
|
@ -221,10 +221,11 @@ class ProtonDriver(base.BaseDriver):
|
|||
self._pid = None
|
||||
self._lock = threading.Lock()
|
||||
|
||||
# TODO(kgiusti): make configurable:
|
||||
self._default_reply_timeout = 30
|
||||
self._default_send_timeout = 60
|
||||
self._default_notify_timeout = 60
|
||||
# timeout for message acknowledgement
|
||||
opt_name = conf.oslo_messaging_amqp
|
||||
self._default_reply_timeout = opt_name.default_reply_timeout
|
||||
self._default_send_timeout = opt_name.default_send_timeout
|
||||
self._default_notify_timeout = opt_name.default_notify_timeout
|
||||
|
||||
def _ensure_connect_called(func):
|
||||
"""Causes a new controller to be created when the messaging service is
|
||||
|
|
Loading…
Reference in New Issue