mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
Merge pull request #590
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
framework:
|
||||
messenger:
|
||||
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
|
||||
# failure_transport: failed
|
||||
|
||||
transports:
|
||||
# https://symfony.com/doc/current/messenger.html#transports
|
||||
# async: '%env(MESSENGER_TRANSPORT_DSN)%'
|
||||
# failed: 'doctrine://default?queue_name=failed'
|
||||
# sync: 'sync://'
|
||||
|
||||
routing:
|
||||
# Route your messages to the transports
|
||||
# 'App\Message\YourMessage': [async, sync]
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
},
|
||||
"env": {
|
||||
"#1": "To use AMQP, also run ‘composer require amqp’",
|
||||
"#2": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages",
|
||||
"#3": "MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages"
|
||||
},
|
||||
"aliases": ["messenger"],
|
||||
"conflict": {
|
||||
"symfony/framework-bundle": "<4.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<bg=blue;fg=white> </>
|
||||
<bg=blue;fg=white> What's next? </>
|
||||
<bg=blue;fg=white> </>
|
||||
|
||||
* You're ready to use the Messenger component. You can define your own message buses
|
||||
or start using the default one right now by injecting the <info>messenger.bus.default</info> service
|
||||
or typehinting <info>Symfony\Component\Messenger\MessageBusInterface</info> in your code.
|
||||
|
||||
* To send messages to a transport and handle them asynchronously:
|
||||
|
||||
1. Uncomment the <comment>MESSENGER_TRANSPORT_DSN</> env var in .env
|
||||
and <comment>framework.messenger.transports.async</> in config/packages/messenger.yaml;
|
||||
2. Route your message classes to the async transport in config/packages/messenger.yaml.
|
||||
|
||||
* <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc/master/messenger.html</>
|
||||
Reference in New Issue
Block a user