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

Add possibility to have more routing keys for one exchange #61

Closed Spilky closed 2 years ago

Spilky commented 2 years ago

This PR is dealing with issue https://github.com/contributte/rabbitmq/issues/59 and add possibility to have more routing keys for one exchange.

Configuration can looks like this:

rabbitmq:
    exchanges:
        testExchange:
            connection: default
            type: direct
            queueBindings:
                testQueue:
                    routingKeys:
                        - key1
                        - key2

But it is still possible to use it like before:

rabbitmq:
    exchanges:
        testExchange:
            connection: default
            type: direct
            queueBindings:
                testQueue:
                    routingKey: key1

cc @f3l1x @paveljanda

paveljanda commented 2 years ago

Thanks! Do you think it would be possible to do it without a BC break?

Spilky commented 2 years ago

@paveljanda look now please. I added new option routingKeys and let routingKey option like it is.

ghost commented 2 years ago

🙏

paveljanda commented 2 years ago

Nice, that's better. Thanks.

Could you add an if clause that would not enable user to set both of those config options? It could prevent some potential bugs.

Spilky commented 2 years ago

@paveljanda I added that if clause here: https://github.com/contributte/rabbitmq/pull/61/files#diff-cc36da72c63c362c7076da3e877940a77546727c17f9b51ad02164553e073281R71. I think that now it is ready to merge and release.

paveljanda commented 2 years ago

Thanks! Last thing - could you please alter the docs? So that all other people can use it? Thanks a lot! :)

Spilky commented 2 years ago

@paveljanda Docs updated.

paveljanda commented 2 years ago

Thanks!