Skip to content

[Messenger] [AMQP] Add arguments to delay queues #44186

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

Closed
GavrilovicAleksa opened this issue Nov 21, 2021 · 4 comments · Fixed by #48603
Closed

[Messenger] [AMQP] Add arguments to delay queues #44186

GavrilovicAleksa opened this issue Nov 21, 2021 · 4 comments · Fixed by #48603

Comments

@GavrilovicAleksa
Copy link

GavrilovicAleksa commented Nov 21, 2021

Description

Currently, amqp-messenger doesn't support input arguments for delay queues. It would be useful if we could add additional arguments.

Example

options:
    delay:
        arguments:
            argument: value
@JanMikes
Copy link

This is related and would solve #46254

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@GavrilovicAleksa
Copy link
Author

Hi Guys, I think that there still isn't an option for this, would you still like to see it? I would create a PR in that case

@N4IR0
Copy link

N4IR0 commented May 10, 2023

This feature would be very helpful since quorum queues don't refresh their queue ttl on queue re-declaration (RabbitMQ Docs). This causes that delayed messages are lost if they get pushed into an already existing delay queue. With this it would be possible to change the queue type to classic.

nicolas-grekas added a commit that referenced this issue Feb 7, 2024
…lay queues (Thomas Beaujean)

This PR was merged into the 7.1 branch.

Discussion
----------

[Messenger][Amqp] Add config option 'arguments' for delay queues

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #44186 #46254
| License       | MIT
| Doc PR        | symfony/symfony-docs#17553

Hi, this PR to allow to add extra arguments to the amqp delay queues that are automatically created.

The use case:
- I do not know in advance the name of the queues (handled by env variables)
- The queues are created automatically by symfony if needed
- I need the deduplication plugin in both the queue and the associated delays queues (enabled with the x-message-deduplication argument)
- I do not want to rewrite all delay arguments, I just want to be able to add or rewrite some

The associated configuration in messenger.yaml
```
        transports:
            async:
                dsn: '%env(MESSENGER_DSN)%'
                options:
                    queues:
                        '%env(MESSENGER_ASYNC_QUEUE_NAME)%':
                            arguments:
                                x-queue-type: 'classic'
                                x-message-deduplication: true
                    delay:
                        arguments:
                            x-queue-type: 'classic'
                            x-message-deduplication: true
```

Commits
-------

94ee8a2 [Messenger] Add config option 'arguments' for delay queues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants