Skip to content

Messenger worker : Transport priorities bypassed with PostgreSQL LISTEN/NOTIFY #58574

@benito103e

Description

@benito103e

Symfony version(s) affected

7.1.5

Description

When using PostgreSqlConnection as messenger transport with use_notify, priorities can be by ignored by worker.

How to reproduce

I have 2 transports using Doctrine :

async_priority_high:
    dsn: "%env(MESSENGER_TRANSPORT_DSN)%"
    options:
        queue_name: high
async_priority_medium:
    dsn: "%env(MESSENGER_TRANSPORT_DSN)%"
    options:
        queue_name: medium

My transport is a Postgresl table. I use the default configuration for the transport :
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0&table_name=core_messenger_message

I run the consumer with bin/console messenger:consume async_priority_high async_priority_medium

Sometimes medium messages are received and handled before high messages, if a lot of medium messages are sent.

Possible Solution

I don't see a very relevant solution, other than disabling use_notify.

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