-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Messengerhelp wantedIssues and PRs which are looking for volunteers to complete them.Issues and PRs which are looking for volunteers to complete them.

Description
For the Prioritized Transports, the example displayed does not work. I solved it in my code using two different dsn (not sure it is the best pratice).
In the doc, we have :
#.env
MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
#config/packages/messenger.yaml
framework:
messenger:
transports:
async_priority_high:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
# queue_name is specific to the doctrine transport
# try "exchange" for amqp or "group1" for redis
queue_name: high
async_priority_low:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
queue_name: low
routing:
'App\Message\SmsNotification': async_priority_low
'App\Message\NewUserWelcomeEmail': async_priority_high
It should be :
#.env
MESSENGER_TRANSPORT_DSN_HIGH=amqp://guest:guest@localhost:5672/%2f/messages_high
MESSENGER_TRANSPORT_DSN_LOW=amqp://guest:guest@localhost:5672/%2f/messages_low
#config/packages/messenger.yaml
framework:
messenger:
transports:
async_priority_high:
dsn: '%env(MESSENGER_TRANSPORT_DSN_HIGH)%'
options:
# queue_name is specific to the doctrine transport
# try "exchange" for amqp or "group1" for redis
queue_name: high
async_priority_low:
dsn: '%env(MESSENGER_TRANSPORT_DSN_LOW)%'
options:
queue_name: low
routing:
'App\Message\SmsNotification': async_priority_low
'App\Message\NewUserWelcomeEmail': async_priority_high
Metadata
Metadata
Assignees
Labels
Messengerhelp wantedIssues and PRs which are looking for volunteers to complete them.Issues and PRs which are looking for volunteers to complete them.