Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] Provide a deduplication strategy to Queue #54126

Copy link
Copy link
Closed
@VincentLanglet

Description

@VincentLanglet
Issue body actions

Description

It would be useful to provide an easy way to handle duplicate message in queue.
I might be wrong but I found nothing implemented yet, just a discussion here #49215

The idea would be to propose something like an interface Message could implement

interface DeduplicatedMessageInterface

and if they doing so, when I try to publish such a message, it checks if the queue already has the same message with the same body. If so, the new message is not added to the queue.

I assume something could be possible with Symfony lock for instance:

  • Before dispatching the message we check there is no lock on the "message identifier".
    • If there is no lock, we're adding one.
    • If there is already a lock, we're not dispatching the message
  • And in the MessageHandler, we're releasing the lock after the execution of the __invoke method.

But maybe a better implementation exists ?

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.