laravel-queue-rabbitmq
laravel-queue-rabbitmq copied to clipboard
[Feature] Support "alternate-exchange" as option in declareExchangeCommand
I would like to be able to create an exchange with the alternative-exchange
option set. There will be other tools to do this, but this artisan command is here and convenient.
What I would like to do, is extend rabbitmq:exchange-declare
so that options can be passed in. Running the command could look something like this:
php rabbitmq:exchange-declare "my-exchange" --option="alternate-exchange=my-unrouted-exchange"
Maybe something other than "=" could separate the option name and value to be a little neater.
Is this something you would accept, in principle, as a PR?
Trying an option format like this:
php artisan rabbitmq:exchange-declare ${RABBITMQ_EXCHANGE_NAME} --option="alternate-exchange|${RABBITMQ_EXCHANGE_NAME}.unrouted"
Because alternate-echange
is an option you can define into rabbitMQ. I can see why you want to be able to add this as an option to the declareExchangeCommand.
Only i would make it an actual option. Just make the option --alternate available and when defined pass it into the create method.
php artisan rabbitmq:exchange-declare --alternate="catchall.unrouted" ${RABBITMQ_EXCHANGE_NAME}
- Branch from the latest v10 version
- write a test for this extra feature
- Alter the code and create an PR.
I'll work on this over the next few weeks.
Closing due to lack of activity and age of the issue. If you still have a need or a question around this, feel free to re-open or start a new one.