diff options
author | Konstantin Kalin <kkalin@mirantis.com> | 2015-12-28 10:42:28 -0800 |
---|---|---|
committer | Konstantin Kalin <kkalin@mirantis.com> | 2015-12-28 10:42:28 -0800 |
commit | e0a9b0c0551eb98d031bec1d4bd621d3e4796977 (patch) | |
tree | 988ba38e9d11be66ff32bf9ab5ae6ed5bc590f9a /oslo_messaging/_drivers/impl_rabbit.py | |
parent | 3de5b6f52e8641d4550b0484d2c81ed870a69a32 (diff) | |
download | oslo-messaging-e0a9b0c0551eb98d031bec1d4bd621d3e4796977.tar.gz |
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
Diffstat (limited to 'oslo_messaging/_drivers/impl_rabbit.py')
-rw-r--r-- | oslo_messaging/_drivers/impl_rabbit.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index 1f75b33..9470b9d 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -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 |