Commit 90238dc4 authored by lukas.burgey's avatar lukas.burgey
Browse files

Fix the broker initialization

parent 78a612b9
Pipeline #81683 passed with stage
in 1 minute and 4 seconds
......@@ -40,17 +40,6 @@ class RabbitMQInstance:
or os.path.basename(sys.argv[0]) in ('pytest', 'py.test')
)
def _init_exchanges(self, channel):
# this is no error
for exchange in self.exchanges:
channel.exchange_declare(
exchange=exchange,
durable=True, # so exchange survive a broker restart
auto_delete=False,
exchange_type='topic',
)
@property
def _params(self):
# we set NO port here, we use the default (probably 5672)
......@@ -64,6 +53,20 @@ class RabbitMQInstance:
),
)
def __init__(self):
# always initialize
self.initialize()
def _init_exchanges(self, channel):
# this is no error
for exchange in self.exchanges:
channel.exchange_declare(
exchange=exchange,
durable=True, # so exchange survive a broker restart
auto_delete=False,
exchange_type='topic',
)
def __str__(self):
return self.host
......@@ -101,6 +104,7 @@ class RabbitMQInstance:
# close channel and connection
connection.close()
# PUBLIC API
# called on client registration to make sure the exchanges exists
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment