|
87 | 87 | use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
88 | 88 | use Symfony\Component\Messenger\MessageBus;
|
89 | 89 | use Symfony\Component\Messenger\MessageBusInterface;
|
| 90 | +use Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory; |
| 91 | +use Symfony\Component\Messenger\Transport\RedisExt\RedisTransportFactory; |
90 | 92 | use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
|
91 | 93 | use Symfony\Component\Messenger\Transport\TransportInterface;
|
92 | 94 | use Symfony\Component\Mime\MimeTypeGuesserInterface;
|
@@ -314,6 +316,16 @@ public function load(array $configs, ContainerBuilder $container)
|
314 | 316 | $container->removeDefinition('console.command.messenger_failed_messages_show');
|
315 | 317 | $container->removeDefinition('console.command.messenger_failed_messages_remove');
|
316 | 318 | $container->removeDefinition('cache.messenger.restart_workers_signal');
|
| 319 | + |
| 320 | + if ($container->hasDefinition('messenger.transport.amqp.factory') && class_exists(AmqpTransportFactory::class)) { |
| 321 | + $container->getDefinition('messenger.transport.amqp.factory') |
| 322 | + ->addTag('messenger.transport_factory'); |
| 323 | + } |
| 324 | + |
| 325 | + if ($container->hasDefinition('messenger.transport.redis.factory') && class_exists(RedisTransportFactory::class)) { |
| 326 | + $container->getDefinition('messenger.transport.redis.factory') |
| 327 | + ->addTag('messenger.transport_factory'); |
| 328 | + } |
317 | 329 | }
|
318 | 330 |
|
319 | 331 | if ($this->httpClientConfigEnabled = $this->isConfigEnabled($container, $config['http_client'])) {
|
@@ -1707,6 +1719,14 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
|
1707 | 1719 |
|
1708 | 1720 | $loader->load('messenger.xml');
|
1709 | 1721 |
|
| 1722 | + if (class_exists(AmqpTransportFactory::class)) { |
| 1723 | + $container->getDefinition('messenger.transport.amqp.factory')->addTag('messenger.transport_factory'); |
| 1724 | + } |
| 1725 | + |
| 1726 | + if (class_exists(RedisTransportFactory::class)) { |
| 1727 | + $container->getDefinition('messenger.transport.redis.factory')->addTag('messenger.transport_factory'); |
| 1728 | + } |
| 1729 | + |
1710 | 1730 | if (null === $config['default_bus'] && 1 === \count($config['buses'])) {
|
1711 | 1731 | $config['default_bus'] = key($config['buses']);
|
1712 | 1732 | }
|
|
0 commit comments