Skip to content

Commit d975444

Browse files
committed
feature #29476 [Messenger] Add a command to setup transports (vincenttouzet)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Messenger] Add a command to setup transports | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This PR add a `SetupTransportsCommand` that allow to setup the transports. Actually the `AMQPTransport` is setup only if debug is enabled. With this PR the new `messenger:setup-transports` will setup all declared transports. Commits ------- fbb534a838 [Messenger] Add a command to setup transports
2 parents 6479cf1 + 7a6623a commit d975444

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CHANGELOG
1919
* Added support for Translator paths, Twig paths in translation commands.
2020
* Added support for PHP files with translations in translation commands.
2121
* Added support for boolean container parameters within routes.
22+
* Added the `messenger:setup-transports` command to setup messenger transports
2223

2324
4.2.0
2425
-----

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ public function load(array $configs, ContainerBuilder $container)
280280
} else {
281281
$container->removeDefinition('console.command.messenger_consume_messages');
282282
$container->removeDefinition('console.command.messenger_debug');
283+
$container->removeDefinition('console.command.messenger_setup_transports');
283284
}
284285

285286
$this->registerValidationConfiguration($config['validation'], $container, $loader);

Resources/config/console.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@
8989
<tag name="monolog.logger" channel="messenger" />
9090
</service>
9191

92+
<service id="console.command.messenger_setup_transports" class="Symfony\Component\Messenger\Command\SetupTransportsCommand">
93+
<argument type="service" id="messenger.receiver_locator" />
94+
<argument type="collection" /> <!-- Receiver names -->
95+
96+
<tag name="console.command" command="messenger:setup-transports" />
97+
</service>
98+
9299
<service id="console.command.messenger_debug" class="Symfony\Component\Messenger\Command\DebugCommand">
93100
<argument type="collection" /> <!-- Message to handlers mapping -->
94101
<tag name="console.command" command="debug:messenger" />

0 commit comments

Comments
 (0)