def _send_result(self, result): with self._create_rmq_client() as mq: msg = messaging.Message() msg.body = result msg.id = result.get('SourceID') mq.send(message=msg, key=CONF.rabbitmq.result_routing_key, exchange=CONF.rabbitmq.result_exchange) return True
def _send_result(self, result): with self._create_rmq_client() as mq: msg = messaging.Message() msg.body = result msg.id = result.get('SourceID') routing_key = CONF.rabbitmq.result_routing_key if ('ReplyTo' in result) and CONF.enable_dynamic_result_queue: routing_key = result.pop('ReplyTo') mq.send(message=msg, key=routing_key, exchange=CONF.rabbitmq.result_exchange) return True