Increase rabbitmq connections attempt
Workers instantly exit if rabbitmq server is not available. This changes use connection_attemps and retry_delay pika connection parameters to try to reconnect before failing. Change-Id: I00ff950270360405da092803c1d251552c837831
This commit is contained in:
parent
db050a3de6
commit
54dcb5309a
@ -107,6 +107,12 @@ lock_path = $state_path/lock
|
|||||||
# The name of the queue that will be created for API events.
|
# The name of the queue that will be created for API events.
|
||||||
# rabbit_event_queue_name=storyboard_events
|
# rabbit_event_queue_name=storyboard_events
|
||||||
|
|
||||||
|
# The number of connection attempts before giving-up
|
||||||
|
# rabbit_connection_attempts = 6
|
||||||
|
|
||||||
|
# The interval between connection attempts (in seconds)
|
||||||
|
# rabbit_retry_delay = 10
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
# This line MUST be changed to actually run storyboard
|
# This line MUST be changed to actually run storyboard
|
||||||
# Example:
|
# Example:
|
||||||
|
@ -40,4 +40,8 @@ NOTIFICATION_OPTS = [
|
|||||||
cfg.StrOpt("rabbit_virtual_host", default="/",
|
cfg.StrOpt("rabbit_virtual_host", default="/",
|
||||||
help="The virtual host within which our queues and exchanges "
|
help="The virtual host within which our queues and exchanges "
|
||||||
"live."),
|
"live."),
|
||||||
|
cfg.IntOpt("rabbit_connection_attempts", default=6,
|
||||||
|
help="The number of connection attempts before giving-up"),
|
||||||
|
cfg.IntOpt("rabbit_retry_delay", default=10,
|
||||||
|
help="The interval between connection attempts (in seconds)")
|
||||||
]
|
]
|
||||||
|
@ -56,7 +56,9 @@ class ConnectionService(object):
|
|||||||
conf.rabbit_host,
|
conf.rabbit_host,
|
||||||
conf.rabbit_port,
|
conf.rabbit_port,
|
||||||
conf.rabbit_virtual_host,
|
conf.rabbit_virtual_host,
|
||||||
self._connection_credentials)
|
self._connection_credentials,
|
||||||
|
connection_attempts=conf.rabbit_connection_attempts,
|
||||||
|
retry_delay=conf.rabbit_retry_delay)
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
"""This method connects to RabbitMQ, establishes a channel, declares
|
"""This method connects to RabbitMQ, establishes a channel, declares
|
||||||
|
Loading…
x
Reference in New Issue
Block a user