pma/amqp

Queue declaration with default exchange

victorprs opened this issue · 2 comments

Looking at the rabbitmq tutorials, there is no need to declare a queue with the default params:

The default exchange is a direct exchange with no name (empty string) pre-declared by the broker. It has one special property that makes it very useful for simple applications: every queue that is created is automatically bound to it with a routing key which is the same as the queue name.

Given that the declaration of the default exchange is automatic, every time that I try to declare the default exchange it gives an error.

Solution:
It is possible to guarantee that exchange is not empty and I'm thinking it would improve the lib. What do you think?

ono commented

Hi @victorprs. I need bit more explanation on your suggestion. Which module and function are you proposing to update? And can you compare the proposed outcome with the current one?

Thanks!

Also @victorprs, you are guaranteed that the default exchange is there, it's just part of the RabbitMQ API (same way you're guaranteed that there's a queue.bind method for example).