Optimize sending of a reply in RPC server

RPC server uses direct_send method to send replies.
 The method sets "passive" flag on an exchange.
 Thus auto_declare doesn't bring any good there, but it costs
 an additional "exchange.declare" call to RabbitMQ.
 simulator.py RPC tests shows that a perfomance gain is ~7%

Change-Id: Ia9f5f9f52c6cb324eca4ca6a63e80d604ddefa23
This commit is contained in:
Konstantin Kalin 2015-12-28 10:42:28 -08:00
parent 3de5b6f52e
commit e0a9b0c055

@ -974,6 +974,7 @@ class Connection(object):
"""Publish a message."""
producer = kombu.messaging.Producer(exchange=exchange,
channel=self.channel,
auto_declare=not exchange.passive,
routing_key=routing_key)
expiration = None