Use default exchange for direct messaging

Lots of exchanges create problems during failover under high
load. Please see bug report for details.

This is step 1 in the process: only using default exchange
when publishing. Consumers will still consume on separate
exchanges (and on default exchange by default) so this
should be (and tested to be) a non-breaking and
upgrade-friendly change.

Step 2 is to update consumers to only listen on default exchange,
to happen in T release.

Change-Id: Id3603f4b7e1274b616d76e1c0c009d2ab7f6efb6
Closes-Bug: #1789177
(cherry picked from commit 3a5de89dd6)
This commit is contained in:
Oleg Bondarev 2018-08-27 12:18:58 +04:00 committed by norman shen
parent 8bebba78a1
commit b67a457e4f
1 changed files with 2 additions and 1 deletions

View File

@ -1116,6 +1116,7 @@ class Connection(object):
responses for call/multicall
"""
# TODO(obondarev): use default exchange since T release
consumer = Consumer(exchange_name=topic,
queue_name=topic,
routing_key=topic,
@ -1282,7 +1283,7 @@ class Connection(object):
def direct_send(self, msg_id, msg):
"""Send a 'direct' message."""
exchange = kombu.entity.Exchange(name=msg_id,
exchange = kombu.entity.Exchange(name='', # using default exchange
type='direct',
durable=False,
auto_delete=True,