I'm trying to write a method that creates new queues with arguments of an existing exchange name, new queue name and routing key. The exchange might be in different types (direct, fanout, topic).
Is there a way to make and bind the queue without knowing the exchange type?
def my_queue(self, exchange_name, queue_name, routing_key):
with connection.acquire(block=True) as conn:
ex = Exchange(exchange_name, type='topic')
queue = Queue(name="my_queue", routing_key="my_key", exchange=ex)
queue.maybe_bind(conn)
queue.declare()