Closed
Description
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