Skip to content

[Messenger] Doctrine Transport not compatible with SQL Server #32585

Closed
@dlegatt

Description

@dlegatt

Symfony version(s) affected: 4.3.2

Description
Doctrine DBAL throws the following exception when using messenger with the Doctrine transport and a SQL Server database.

sqlsrv does not support named parameters to queries, use question mark (?) placeholders instead.

How to reproduce
Create a new symfony project and install messenger:

symfony new messenger-doctrine-sqlsrv --full
cd messenger-doctrine-sqlsrv
composer req messenger

Configure .env for the database DSN and messenger transport DSN

.
.
DATABASE_URL=sqlsrv://sa:Password01@127.0.0.1/test_db
.
.
MESSENGER_TRANSPORT_DSN=doctrine://default
.

Configure messenger.yaml

framework:
    messenger:
        transports:
             async: '%env(MESSENGER_TRANSPORT_DSN)%'
.
.

Configure doctrine.yaml

doctrine:
    dbal:
        driver: 'sqlsrv'
        charset: UTF-8
        default_table_options:
            charset: UTF-8
.
.

From the terminal, run ./bin/console messenger:consume

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