Open avico78 opened 1 year ago
My program runs and create many queues, In some case , need to preform multiple queues deletion(or part of maintenance). i couldn't find how i can achieve it with aio_pika .
just an example what i want to accomplish
import aio_pika async def delete_queues_with_wildcard(pattern): connection = await aio_pika.connect_robust("amqp://localhost/") channel = await connection.channel() async for queue_name, _, _ in channel.queues(): if queue_name.startswith(pattern): queue = await channel.get_queue(queue_name) await queue.delete() await connection.close() await delete_queues_with_wildcard("somet_prefix*")
Or having get_queues with support of filtering
queues = await self.channel.get_queues(filter="customer_*", passive=True)
AMQP 0.9.x protocol is not provide something like this. The get_queue method is a syntax sugar for declaring queue with a passive flag
My program runs and create many queues, In some case , need to preform multiple queues deletion(or part of maintenance). i couldn't find how i can achieve it with aio_pika .
just an example what i want to accomplish
Or having get_queues with support of filtering