cmobi/rabbitmq-bundle

Bundle to manager RabbitMQ message broker using phpamqplib

Installs: 6 595

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 2

Open Issues: 2

Type:symfony-bundle

v1.2.13 2017-05-29 23:58 UTC

README

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