contributte / rabbitmq

🐰 RabbitMQ (AMQP, STOMP, MQTT) using BunnyPHP for Nette Framework (@nette).
https://contributte.org/packages/contributte/rabbitmq.html
MIT License
24 stars 25 forks source link

Bind one queue to exchange with multiple binding keys #59

Closed VojtechBuba closed 7 months ago

VojtechBuba commented 2 years ago

Hello RabbitMq supports binding one queue to exchange over multiple binding keys. I am missing this function in this library and i would really appreciate if it can be possible.

If it is possible, can you tell me how?

Currently only string value is possible to pass as a value to attribute routingKey.

    exchanges:
        testExchange:
            connection: default
            type: fanout
            queueBindings:
                testQueue:
                    routingKey: testRoutingKey
            # force exchange declare on first exchange operation during request
            # autoCreate: true

It would be great if something like this will be possible

    exchanges:
        testExchange:
            connection: default
            type: fanout
            queueBindings:
                testQueue:
                    routingKey: 
                        - 'FirstKey.#'
                        - 'SecondKey.*'      
            # force exchange declare on first exchange operation during request
            # autoCreate: true
bckp commented 1 year ago

you can see mallgroup/rabbitmq, there is exactly this implemented :) BTW:In your exmple you use fanout that does not use routing key...

VojtechBuba commented 7 months ago

https://github.com/contributte/rabbitmq/pull/61