The bundle provides a RabbitMq integration for your Symfony2 Project. Based on php-amqplib.
$ composer require cmobi/rabbitmq-bundle --no-update
Register the bundle:
// app/AppKernel.php
public function registerBundles()
{
return array(
new \Cmobi\RabbitmqBundle\CmobiRabbitmqBundle(),
// ...
);
}
Install the bundle:
$ composer update cmobi/rabbitmq-bundle
Add cmobi_rabbitmq
section in your configuration file:
cmobi_rabbitmq:
connections:
default:
host: 172.17.0.1
port: 5672
user: 'guest'
password: 'guest'
vhost: '/'
lazy: false
connection_timeout: 3
read_write_timeout: 3
# requires php-amqplib v2.4.1+ and PHP5.4+
keepalive: false
# requires php-amqplib v2.4.1+
heartbeat: 0
Register rpc servers:
cmobi_rabbitmq:
//...
rpc_servers:
primary_server:
queue: { name: 'primary_queue' }
second_server:
queue: { name: 'second_queue' }