Skip to content

Commit f54b694

Browse files
authored
[symfony/messenger] add reset_on_message in 5.4 (remove in 6.0) (#1080)
1 parent f01c4a5 commit f54b694

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
framework:
2+
messenger:
3+
# reset services after consuming messages
4+
reset_on_message: true
5+
6+
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
7+
# failure_transport: failed
8+
9+
transports:
10+
# https://symfony.com/doc/current/messenger.html#transport-configuration
11+
# async: '%env(MESSENGER_TRANSPORT_DSN)%'
12+
# failed: 'doctrine://default?queue_name=failed'
13+
# sync: 'sync://'
14+
15+
routing:
16+
# Route your messages to the transports
17+
# 'App\Message\YourMessage': async

symfony/messenger/5.4/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"copy-from-recipe": {
3+
"config/": "%CONFIG_DIR%/"
4+
},
5+
"env": {
6+
"#1": "Choose one of the transports below",
7+
"#2": "MESSENGER_TRANSPORT_DSN=doctrine://default",
8+
"#3": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages",
9+
"#4": "MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages"
10+
},
11+
"aliases": ["messenger"],
12+
"conflict": {
13+
"symfony/framework-bundle": "<4.3"
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* You're ready to use the Messenger component. You can define your own message buses
2+
or start using the default one right now by injecting the <info>message_bus</info> service
3+
or type-hinting <info>Symfony\Component\Messenger\MessageBusInterface</info> in your code.
4+
5+
* To send messages to a transport and handle them asynchronously:
6+
7+
1. Uncomment the <info>MESSENGER_TRANSPORT_DSN</> env var in <comment>.env</>
8+
and <info>framework.messenger.transports.async</> in <comment>config/packages/messenger.yaml</>;
9+
2. Route your message classes to the async transport in <comment>config/packages/messenger.yaml</>.
10+
11+
* <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc/current/messenger.html</>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
framework:
2+
messenger:
3+
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
4+
# failure_transport: failed
5+
6+
transports:
7+
# https://symfony.com/doc/current/messenger.html#transport-configuration
8+
# async: '%env(MESSENGER_TRANSPORT_DSN)%'
9+
# failed: 'doctrine://default?queue_name=failed'
10+
# sync: 'sync://'
11+
12+
routing:
13+
# Route your messages to the transports
14+
# 'App\Message\YourMessage': async

symfony/messenger/6.0/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"copy-from-recipe": {
3+
"config/": "%CONFIG_DIR%/"
4+
},
5+
"env": {
6+
"#1": "Choose one of the transports below",
7+
"#2": "MESSENGER_TRANSPORT_DSN=doctrine://default",
8+
"#3": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages",
9+
"#4": "MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages"
10+
},
11+
"aliases": ["messenger"],
12+
"conflict": {
13+
"symfony/framework-bundle": "<4.3"
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* You're ready to use the Messenger component. You can define your own message buses
2+
or start using the default one right now by injecting the <info>message_bus</info> service
3+
or type-hinting <info>Symfony\Component\Messenger\MessageBusInterface</info> in your code.
4+
5+
* To send messages to a transport and handle them asynchronously:
6+
7+
1. Uncomment the <info>MESSENGER_TRANSPORT_DSN</> env var in <comment>.env</>
8+
and <info>framework.messenger.transports.async</> in <comment>config/packages/messenger.yaml</>;
9+
2. Route your message classes to the async transport in <comment>config/packages/messenger.yaml</>.
10+
11+
* <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc/current/messenger.html</>

0 commit comments

Comments
 (0)