Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] [Amqp] Add default exchange support #54275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

ilyachase
Copy link
Contributor

@ilyachase ilyachase commented Mar 13, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #45784
License MIT

Usage:

transports:
  my_queue:
    dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
    options:
      exchange:
        # Indicates that the default Exchange is to be used
        name: ''
        default_publish_routing_key: my_queue

      queues:
        my_queue: ~

It is not a breaking change, because currently using name: '' leads to the Could not declare exchange. Exchanges must have a name error. This PR allows using the default exchange instead.

It's also possible to add more queues and then use them directly with a stamp:

          queues:
            foo: ~
            bar: ~
$messageBus->dispatch(new MyMessage(), [new AmqpStamp('bar')]);

@carsonbot carsonbot added this to the 7.1 milestone Mar 13, 2024
@carsonbot carsonbot changed the title [Messenger][Amqp] Added default exchange support [Messenger] [Amqp] Added default exchange support Mar 13, 2024
@ilyachase ilyachase changed the title [Messenger] [Amqp] Added default exchange support [Messenger] [Amqp] Add default exchange support Mar 13, 2024
@ilya-levin-lokalise
Copy link

@fabian @nicolas-grekas @stof Hey folks, sorry for pinging you directly, but you are the people who helped move forward my previous PR. Could this one also get some attention - it had none for longer than a month? 🙏

@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 10, 2024
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (although I don't have any knowledge about the default exhange, so I'd trust you on this aspect).

Please just mention this new case in the descriptions of the options (L138)

@ilyachase
Copy link
Contributor Author

@fabpot @stof Hey folks, can I have one more review here, please? 🙂

@ilyachase
Copy link
Contributor Author

@nicolas-grekas hello, how can we move forward with this PR? 🙏

@ilyachase
Copy link
Contributor Author

Hi @OskarStark do you think we can get this one gong? 🙂

@ilyachase
Copy link
Contributor Author

@fabpot @stof Hey folks, can I have one more review here, please? 🙂

@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to see this one in 7.3, we're using the default exchange for most of our queues now and having to disable auto_setup is not ideal.

@ilyachase
Copy link
Contributor Author

@wouterj Thanks for creating traction. I just rebased my branch to the freshest 7.3 branch.

@OskarStark OskarStark changed the title [Messenger] [Amqp] Add default exchange support [Messenger][Amqp] Add default exchange support Mar 10, 2025
@wouterj wouterj added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Mar 27, 2025
@carsonbot carsonbot changed the title [Messenger][Amqp] Add default exchange support [Messenger] [Amqp] Add default exchange support Mar 27, 2025
@fabpot
Copy link
Member

fabpot commented Mar 28, 2025

Thank you @ilyachase.

@fabpot fabpot merged commit 23e2230 into symfony:7.3 Mar 28, 2025
7 of 8 checks passed
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Messenger ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AmqpMessenger] Allow using the default amqp exchange
8 participants