2017 © Pedro Peláez
 

symfony-bundle rabbitmq-bundle

Hello RabbitMq Bundle

image

hgtan/rabbitmq-bundle

Hello RabbitMq Bundle

  • Thursday, July 23, 2015
  • by hoangthienan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

HelloRabbitMqBundle

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Build Status Coverage Status Quality Score HHVM Status, (*2)

SensioLabsInsight, (*3)

Messaging in your application via RabbitMQ using the php-amqplib library and the following bundle: * RabbitMqBundle, (*4)

Installation

Step 1: Using Composer

composer.json, (*5)

    php composer.phar require hgtan/rabbitmq-bundle:dev-master

Step 2 : Register the bundle

Then register the bundle with your kernel:, (*6)

    <?php

    // in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new Hgtan\Bundle\HelloRabbitMqBundle\HgtanHelloRabbitMqBundle(),
        // ...
    );

Step 3 : Configure the bundle

    # app/config/config.yml
    old_sound_rabbit_mq:
        connections:
            default:
                host:     'localhost'
                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
        producers:
            hello_world:
                connection:       default
                exchange_options: {name: 'hello', type: direct}
                class:            Hgtan\Bundle\HelloRabbitMqBundle\Cakper\HelloProducer
        consumers:
            hello_world:
                connection:       default
                exchange_options: {name: 'hello', type: direct}
                queue_options:    {name: 'hello'}
                callback:         hello_world_service

Import HelloRabbitMqBundle routing files, (*7)

    # app/config/routing.yml
    hgtan_hello_rabbit_mq:
        resource: "@HgtanHelloRabbitMqBundle/Controller/"
        type:     annotation
        prefix:   /

Step 4 : Example

    #RabbitMQ Management
    http://localhost:15672/#/

    $ php app/console server:run

    $ php app/console rabbitmq:consumer hello_world

    # Limit number of messages
    $ php app/console rabbitmq:consumer hello_world -m 10

    http://127.0.0.1:8000/hello/rabbitmq

The Versions

23/07 2015

dev-master

9999999-dev http://hoangthienan.github.io

Hello RabbitMq Bundle

  Sources   Download

MIT

The Requires

 

rabbitmq symfony2 queue message amqp