Skip to content

Commit

Permalink
Use same namespace for kombu keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dlunch committed May 8, 2023
1 parent bb31984 commit 1d3218a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kombu/transport/redis_cluster.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from contextlib import contextmanager
from time import time
from queue import Empty

from kombu.five import Empty
from kombu.utils.encoding import bytes_to_str
from kombu.utils.eventio import READ, ERR
from kombu.utils.json import loads
Expand Down Expand Up @@ -159,7 +159,7 @@ class Channel(RedisChannel):
QoS = QoS
socket_keepalive = True

namespace = 'default'
namespace = '{default}'
keyprefix_queue = '/{namespace}/_kombu/binding%s'
keyprefix_fanout = '/{namespace}/_kombu/fanout.'
unacked_key = '/{namespace}/_kombu/unacked'
Expand Down Expand Up @@ -187,11 +187,12 @@ def __init__(self, conn, *args, **kwargs):
'unacked_mutex_key',
]

super().__init__(conn, *args, **kwargs)

for key in keys:
value = options.get(key, getattr(self, key))
options[key] = value.format(namespace=namespace)
setattr(self, key, value.format(namespace=namespace))

super().__init__(conn, *args, **kwargs)
self.client.info()

@contextmanager
Expand Down

0 comments on commit 1d3218a

Please sign in to comment.