Skip to content

Commit 694e08b

Browse files
author
wangrui
committed
fix problem about rabbitmqBundle's rpc, when use symfony4
[vagrant@bogon s4]$ php bin/console rabbitmq:rpc-server test_server -vvv 2018-01-03T08:00:17+00:00 [error] Error thrown while running command "rabbitmq:rpc-server test_server -vvv". Message: "The "old_sound_rabbit_mq.test_server_server" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead." 2018-01-03T08:00:17+00:00 [debug] Command "rabbitmq:rpc-server test_server -vvv" exited with code "1" In Container.php line 252: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The "old_sound_rabbit_mq.test_server_server" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
1 parent 6c0407c commit 694e08b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

DependencyInjection/OldSoundRabbitMqExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ protected function loadConnections()
104104
$definition->setFactoryMethod('createConnection');
105105
}
106106
$definition->addTag('old_sound_rabbit_mq.connection');
107+
$definition->setPublic(true);
107108

108109
$this->container->setDefinition(sprintf('old_sound_rabbit_mq.connection.%s', $key), $definition);
109110
}
@@ -511,6 +512,7 @@ protected function loadRpcClients()
511512
if (array_key_exists('direct_reply_to', $client)) {
512513
$definition->addMethodCall('setDirectReplyTo', array($client['direct_reply_to']));
513514
}
515+
$definition->setPublic(true);
514516

515517
$this->container->setDefinition(sprintf('old_sound_rabbit_mq.%s_rpc', $key), $definition);
516518
}

0 commit comments

Comments
 (0)