laravel-queue-rabbitmq icon indicating copy to clipboard operation
laravel-queue-rabbitmq copied to clipboard

[Feature] Support "alternate-exchange" as option in declareExchangeCommand

Open judgej opened this issue 4 years ago • 3 comments

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?

judgej avatar Oct 16 '20 16:10 judgej

Trying an option format like this:

php artisan rabbitmq:exchange-declare ${RABBITMQ_EXCHANGE_NAME} --option="alternate-exchange|${RABBITMQ_EXCHANGE_NAME}.unrouted"

judgej avatar Oct 17 '20 23:10 judgej

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.

adm-bome avatar Oct 29 '20 00:10 adm-bome

I'll work on this over the next few weeks.

judgej avatar Oct 29 '20 12:10 judgej

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.

khepin avatar Jan 26 '23 19:01 khepin