From 6c1f08f353e625778bd7e2b44051a66c5586190f Mon Sep 17 00:00:00 2001 From: Matthias Breddin Date: Tue, 28 Mar 2017 23:33:35 +0200 Subject: [PATCH 1/2] MessageBusFactory cannot access private service In the MessageBusFactory the container is accessed via get(). The `prooph_service_bus.container_plugin` is marked private,thus cannot be accessed. Any specific reason to keep it private? --- src/Resources/config/service_bus.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/config/service_bus.xml b/src/Resources/config/service_bus.xml index d3b46fb..e544d45 100644 --- a/src/Resources/config/service_bus.xml +++ b/src/Resources/config/service_bus.xml @@ -18,7 +18,7 @@ - + From d937e521236358c6f91b12e8584b21690a15f378 Mon Sep 17 00:00:00 2001 From: Matthias Breddin Date: Tue, 28 Mar 2017 23:45:12 +0200 Subject: [PATCH 2/2] Make message factory plugin and router plugin accessible in container --- src/DependencyInjection/ProophServiceBusExtension.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DependencyInjection/ProophServiceBusExtension.php b/src/DependencyInjection/ProophServiceBusExtension.php index 3594e6f..473d3f7 100644 --- a/src/DependencyInjection/ProophServiceBusExtension.php +++ b/src/DependencyInjection/ProophServiceBusExtension.php @@ -146,6 +146,7 @@ private function loadBus(string $type, string $name, array $options, ContainerBu $messageFactoryPluginId = 'prooph_service_bus.message_factory_plugin.'.$name; $messageFactoryPluginDefinition = new DefinitionDecorator('prooph_service_bus.message_factory_plugin'); $messageFactoryPluginDefinition->setArguments([new Reference($messageFactoryId)]); + $messageFactoryPluginDefinition->setPublic(true); $container->setDefinition( $messageFactoryPluginId, @@ -159,6 +160,7 @@ private function loadBus(string $type, string $name, array $options, ContainerBu $routerId = 'prooph_service_bus.' . $name . '.router'; $routerDefinition = new DefinitionDecorator($options['router']['type']); $routerDefinition->setArguments([$options['router']['routes'] ?? []]); + $routerDefinition->setPublic(true); $container->setDefinition($routerId, $routerDefinition); }