Skip to content
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

[Messenger][AMQP] Allow to opt out to autosetup delay exchange in configuration #54831

Open
pierreboissinot opened this issue May 3, 2024 · 1 comment

Comments

@pierreboissinot
Copy link

pierreboissinot commented May 3, 2024

Description

It seems that we cannot configure symfony/messenger to prevent auto setup for delay exchange.

$this->autoSetupExchange = $this->autoSetupDelayExchange = $connectionOptions['auto_setup'] ?? true;

When an application is just a publisher but doesn't consume any queue, there is no need to auto setup a delay exchange.

I'm actually working on a PR about this.

Example

Proposal:
Add the option auto_setup for delay, default true.

framework:
    messenger:
        transports:
            async_transport:
        [...]
       
                # https://symfony.com/doc/current/messenger.html#amqp-transport
                options:
                    delay:
                        auto_setup: false
                    queues: []
[...]

With this option, the delay exchange will not be declared there:

$this->getDelayExchange()->declareExchange();

Also, add a condition in Connection->setup to call setupDelayExchange only if delay exchange is not disabled (transport retry_strategy.max_retries equals 0 ? Not sure because delay may be use in other use cases than retry)

@chalasr
Copy link
Member

chalasr commented May 4, 2024

Makes sense to me 👍

transport retry_strategy.max_retries equals 0 ? Not sure because delay may be use in other use cases than retry

Not sure either.

@OskarStark OskarStark changed the title feat(messenger)[AMQP transport]: allow to opt out to autosetup delay exchange in configuration [Messenger][AMQP] Allow to opt out to autosetup delay exchange in configuration May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants