mookofe/tail

Working with queue routing / binding is not possible

Opened this issue · 2 comments

In case you want to push a message to multiple queues (because different clients have an interest of them) you need to create a queue which is bind to a defined routing key.

https://www.rabbitmq.com/e2e.html

The 3rd parameter of the queue_bind method defines the routing key.
https://github.com/mookofe/tail/blob/master/src/Connection.php#L94

Just allow to set a routing key by option.

And if I'm using topic exchange type and already have bound queues to exchange through admin interface, https://github.com/mookofe/tail/blob/master/src/Connection.php#L154 creates another bindings for every bound to exchange queue (without any routing key).
It doesn't interfere me for publishing messages by topic through exchange, but it allows to publish message for every subscribed to exchange queue with code:

\Tail::add('', json_encode(['test_key' => 'test_value']))

(with empty routing key)
Maybe it's worth to create extra parameter for Connection object for preventing auto binding with empty routing key

Hi all,

Curious if we can expect any movement on this?
Also - any alternatives that you can advise?

Thanks in advance