Answer the question
In order to leave comments, you need to log in
How to include rabbitmq-bundle in your 3thd party bundle?
Good afternoon, I am writing my 3thd party bundle on Symfony 3, the meaning of which is to raise several queues and 1 rpc connection.
So in the bundle configuration folder there is a rabbit_mq.yml file with approximately the following content:
old_sound_rabbit_mq:
consumers:
search_index:
connection: default
exchange_options: {name: 'search-index', type: direct}
queue_options: {name: 'search-index', durable: true}
callback: search.queue_consumer.index_consumer
rpc_servers:
search:
connection: default
callback: search.queue_consumer.search_consumer
<?php
namespace SearchServerBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension as DependencyInjectionExtension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration.
*
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
*/
class Extension extends DependencyInjectionExtension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('parameters.yml');
$loader->load('services.yml');
$loader->load('rabbit_mq.yml');
}
}
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
There is no extension able to load the configuration for "old_sound_rabbit_mq" (in /home/vagrant/projects/general/src/SearchServerBundle/D
ependencyInjection/../Resources/config/rabbit_mq.yml). Looked for namespace "old_sound_rabbit_mq", found none
Answer the question
In order to leave comments, you need to log in
Your band should not "think" for another bundle and go to app/config/config.yml.
1. Or you take php-amqplib / php-amqplib dependencies in your gang and write a wrapper (in other words, create an analogue of RabbitMqBundle)
2. You do not touch the library and install RabbitMqBundle as a dependency and use it through the application config and common interfaces. (I will also add that the dependence of one bundle on another is bad)
3. You create a bundle and override RabbitMqBundle symfony.com/doc/current/cookbook/bundles/inheritan...
4. You override the RabbitMqBundle config when initializing bundles. symfony.com/doc/current/cookbook/bundles/prepend_e...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question