Skip to content

[Messenger][Feature] Failed queue per transport #34911

Closed
@monteiro

Description

@monteiro

Description
Currently we can only set one failed queue that is available for every transport.

What happens if we want different behaviours?

Like, one queue that we just want to discard the failed queue and others where we care and want to use the failed queue (a specific one or the same global one)?

Example

# config/packages/messenger.yaml
framework:
    # no need to set failed transport globally if I want a specific behaviour per transport.
    messenger:
        transports:
            failed: 'doctrine://default?queue_name=failed'
            failed_important: 'doctrine://default?queue_name=failed_important'
            async:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                failure_transport: failed
                retry_strategy:
                    max_retries: 3
                    delay: 1000
                    multiplier: 2
            async_no_failure_transport:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                retry_strategy:
                    max_retries: 3
                    delay: 1000
                    multiplier: 2
            async_send_specific_failure_queue:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                failure_transport: failed_important
                retry_strategy:
                    max_retries: 3
                    delay: 1000
                    multiplier: 2

This feature covers for example cases where you need to make distinguish between:

  • Events that are constantly being generated and you don't care if they fail after the number of retries
  • Events that you need to be absolutely sure that they need to be executed, and moved to a different failed queue (to be debugged by a specific team related with a specific queue. It could even be a very important queue, and you need to prioritise the debug of those events)

I don't mind to try to implement this behaviour.
Just wanted to know your feedback.

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