hgtan/rabbitmq-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hgtan/rabbitmq-bundle

Composer 安装命令:

composer require hgtan/rabbitmq-bundle

包简介

Hello RabbitMq Bundle

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Build Status Coverage Status Quality Score HHVM Status

SensioLabsInsight

Messaging in your application via RabbitMQ using the php-amqplib library and the following bundle:

Installation

Step 1: Using Composer

composer.json

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

Step 2 : Register the bundle

Then register the bundle with your kernel:

    <?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

    # 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

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-07