Skip to content

Commit

Permalink
Merge pull request #3 from ingresse/feature/add-exchange-declare
Browse files Browse the repository at this point in the history
add exchange declare
  • Loading branch information
JonasSFreire authored Feb 8, 2018
2 parents 08a79a8 + f9ce7d7 commit d7c4cf0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions message_queue/adapters/amqp_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,23 @@ def configurate_queue(self, **kwargs):
LOGGER.debug('Queue configured: queue=%r, basic_ack=%r, prefetch_count=%r',
self.queue, self.basic_ack, self.prefetch_count)

def configurate_exchange(self, **kwargs):
"""Configurate the exchange.
:param string exchange: Exchange name to connect
:param string exchange_type: Exchange type
"""
if not self.queue:
self.queue = kwargs.get('exchange', '')

self.channel.exchange_declare(
exchange = self.queue,
exchange_type = kwargs.get('exchange_type', 'fanout')
)

LOGGER.debug('Exchange configured: exchange=%r', self.queue)

def connect(self):
"""Connect to AMQP server usgin BlockingConnection.
Expand Down

0 comments on commit d7c4cf0

Please sign in to comment.