Skip to content

Latest commit

 

History

History
74 lines (58 loc) · 2.46 KB

README.md

File metadata and controls

74 lines (58 loc) · 2.46 KB

CmobiRabbitmqBundle

Build Status Coverage Status Scrutinizer Code Quality Dependency Status

Latest Stable Version Latest Unstable Version Total Downloads License

The bundle provides a RabbitMq integration for your Symfony2 Project. Based on php-amqplib.

Installation

$ 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

Usage:

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' }