Closed
Description
Symfony version(s) affected: >=5.1.0
Description
Trying to configure redis transport in messenger component via both framework bundle configuration framework.messenger.transports.*.options
and query parameters in DSN leads to drop of options defined in framework.messenger.transports.*.options
.
How to reproduce
- Configure messenger bundle as follows:
framework:
messenger:
transports:
tasks:
dsn: '%env(APP_REDIS_DSN)%'
options:
stream: my.tasks
group: app
consumer: app
delete_after_ack: true
- Define env variable
APP_REDIS_DSN
with query string
APP_REDIS_DSN=redis://localhost?dbindex=2
- Start a consumer
bin/console messenger:consume tasks
- As a result only dbindex=2 will be passed into redis Connection. Parameters from
framework.messenger.transports.tasks.options
are lost
Possible Solution
Replace this line with
parse_str($parsedUrl['query'], $queryOptions);
$redisOptions += $queryOptions;
Additional context