Enable HA & TTL on declared queues

Change-Id: Idaed8621e4c14c49d9173243ec5af444e9a3a80e
This commit is contained in:
Serg Melikyan 2013-11-22 18:28:48 +04:00
parent 1ad08099cf
commit 214b457636
4 changed files with 7 additions and 6 deletions

View File

@ -63,8 +63,8 @@ class ConductorWorkflowService(service.Service):
while True: while True:
try: try:
with self.create_rmq_client() as mq: with self.create_rmq_client() as mq:
mq.declare('tasks', 'tasks') mq.declare('tasks', 'tasks', enable_ha=True)
mq.declare('task-results') mq.declare('task-results', enable_ha=True)
with mq.open('tasks', with mq.open('tasks',
prefetch_count= prefetch_count=
cfg.CONF.max_environments) as subscription: cfg.CONF.max_environments) as subscription:

View File

@ -19,7 +19,7 @@ class VmAgentExecutor(CommandBase):
self._pending_list = [] self._pending_list = []
self._results_queue = '-execution-results-%s' % str(stack).lower() self._results_queue = '-execution-results-%s' % str(stack).lower()
self._reporter = reporter self._reporter = reporter
rmqclient.declare(self._results_queue) rmqclient.declare(self._results_queue, enable_ha=True, ttl=86400000)
def execute(self, template, mappings, unit, service, callback, metadata_id, def execute(self, template, mappings, unit, service, callback, metadata_id,
timeout=None): timeout=None):
@ -46,7 +46,7 @@ class VmAgentExecutor(CommandBase):
msg = Message() msg = Message()
msg.body = template msg.body = template
msg.id = msg_id msg.id = msg_id
self._rmqclient.declare(queue) self._rmqclient.declare(queue, enable_ha=True, ttl=86400000)
self._rmqclient.send(message=msg, key=queue) self._rmqclient.send(message=msg, key=queue)
log.info('Sending RMQ message {0} to {1} with id {2}'.format( log.info('Sending RMQ message {0} to {1} with id {2}'.format(
TokenSanitizer().sanitize(template), queue, msg_id)) TokenSanitizer().sanitize(template), queue, msg_id))

View File

@ -24,7 +24,7 @@ class Reporter(object):
self._rmqclient = rmqclient self._rmqclient = rmqclient
self._task_id = task_id self._task_id = task_id
self._environment_id = environment_id self._environment_id = environment_id
rmqclient.declare('task-reports') rmqclient.declare('task-reports', enable_ha=True)
def report_generic(self, text, details=None, level='info'): def report_generic(self, text, details=None, level='info'):
return self._report_func(None, None, text, details, level) return self._report_func(None, None, text, details, level)

View File

@ -11,7 +11,8 @@ netaddr>=0.7.6
oslo.config>=1.2.0 oslo.config>=1.2.0
deep deep
murano-common>=0.2.2 # Please, revert to murano-common>=x.x.x before release
http://tarballs.openstack.org/murano-common/murano-common-master.tar.gz#egg=murano-common-0.4
PyYAML>=3.1.0 PyYAML>=3.1.0
murano-metadataclient==0.4.a13.gd65dfd2 murano-metadataclient==0.4.a13.gd65dfd2
python-neutronclient>=2.3.1 python-neutronclient>=2.3.1