|
84 | 84 | use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
85 | 85 | use Symfony\Component\Messenger\MessageBus;
|
86 | 86 | use Symfony\Component\Messenger\MessageBusInterface;
|
| 87 | +use Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory; |
| 88 | +use Symfony\Component\Messenger\Transport\RedisExt\RedisTransportFactory; |
87 | 89 | use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
|
88 | 90 | use Symfony\Component\Messenger\Transport\TransportInterface;
|
89 | 91 | use Symfony\Component\Mime\MimeTypeGuesserInterface;
|
@@ -312,6 +314,16 @@ public function load(array $configs, ContainerBuilder $container)
|
312 | 314 | $container->removeDefinition('console.command.messenger_failed_messages_show');
|
313 | 315 | $container->removeDefinition('console.command.messenger_failed_messages_remove');
|
314 | 316 | $container->removeDefinition('cache.messenger.restart_workers_signal');
|
| 317 | + |
| 318 | + if ($container->hasDefinition('messenger.transport.amqp.factory') && class_exists(AmqpTransportFactory::class)) { |
| 319 | + $container->getDefinition('messenger.transport.amqp.factory') |
| 320 | + ->addTag('messenger.transport_factory'); |
| 321 | + } |
| 322 | + |
| 323 | + if ($container->hasDefinition('messenger.transport.redis.factory') && class_exists(RedisTransportFactory::class)) { |
| 324 | + $container->getDefinition('messenger.transport.redis.factory') |
| 325 | + ->addTag('messenger.transport_factory'); |
| 326 | + } |
315 | 327 | }
|
316 | 328 |
|
317 | 329 | if ($this->httpClientConfigEnabled = $this->isConfigEnabled($container, $config['http_client'])) {
|
@@ -1567,6 +1579,14 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
|
1567 | 1579 |
|
1568 | 1580 | $loader->load('messenger.xml');
|
1569 | 1581 |
|
| 1582 | + if (class_exists(AmqpTransportFactory::class)) { |
| 1583 | + $container->getDefinition('messenger.transport.amqp.factory')->addTag('messenger.transport_factory'); |
| 1584 | + } |
| 1585 | + |
| 1586 | + if (class_exists(RedisTransportFactory::class)) { |
| 1587 | + $container->getDefinition('messenger.transport.redis.factory')->addTag('messenger.transport_factory'); |
| 1588 | + } |
| 1589 | + |
1570 | 1590 | if (null === $config['default_bus'] && 1 === \count($config['buses'])) {
|
1571 | 1591 | $config['default_bus'] = key($config['buses']);
|
1572 | 1592 | }
|
|
0 commit comments