bschmitt / laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages
MIT License
268 stars 86 forks source link

Unable to use default exchange #33

Open verwilst opened 6 years ago

verwilst commented 6 years ago

Setting exchange to '' gives the error that the exchange parameter isn't provided in the config. $channel->basic_publish() in php-amqplib accepts '' as the default exchange though, sending to a queue with the same name as the routing key. Another issue ( after commenting the empty($this->getProperty('exchange')) check ), is that you always declare an exchange. That is denied for the default exchange. Commenting out the exchange-declare block as well makes me successfully deliver a message to my queue through the default exchange.

verwilst commented 6 years ago

I am aware that i can get to the same result by using amq.direct, and binding the queue to the identically-named routing key btw. ;-) But that one requires a bind for every queue, which isnt needed when using the default exchange.

stevenklar commented 6 years ago

Reconsider the use of exchange in certain situations should also fix other issues. (e. g. #36 and #37) Feel free to propose an example if you are still interested.

MattBearson commented 5 years ago

Hi guys, I got pretty the same problem, but with consumer, if I want to consume messages just from a queue, it will create a default topic and assign it to the queue. I think we should have a possibility to consume just a queue without assigning it to the default topic.

liviublidar commented 2 years ago

@stevenklar same as https://github.com/bschmitt/laravel-amqp/issues/78 ?