myonlinestore/rabbitmq-manager-bundle

This package is abandoned and no longer maintained. The author suggests using the phobetor/rabbitmq-supervisor-bundle package instead.

Configuration generator for RabbitMQ with Supervisord and rabbitmq-cli-consumer support

0.1.2 2017-09-13 07:34 UTC

This package is auto-updated.

Last update: 2019-03-28 11:21:46 UTC


README

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads

Introduction

This package is based on https://github.com/Phobetor/rabbitmq-supervisor-bundle and has additional support for https://github.com/ricbra/rabbitmq-cli-consumer. To avoid runtime cache in a (more) efficient way.

Installation

Require the bundle and its dependencies with composer:

$ composer require myonlinestore/rabbitmq-manager-bundle

Register the bundle into your app/AppKernel.php:

public function registerBundles()
{
    $bundles = [
        new MyOnlineStore\Bundle\RabbitMqManagerBundle\RabbitMqManagerBundle(),
    ];
}

Usage

All configuration options are optional.

Full Default Configuration

rabbit_mq_manager:
    path: "%kernel.root_dir%/../var/supervisor/%kernel.name%"
    commands: # console commands to execute for specific worker types
      cli_consumer_invoker: "rabbitmq-manager:consumer" # this will use the rabbitmq-cli-consumer invoker, defined within this package.
      consumers: "rabbitmq:consumer" # OldSoundRabbitMqBundle default consumer command
      rpc_servers: "rabbitmq:rpc-server" # OldSoundRabbitMqBundle default rpc-server command
    consumers:
      general:
        processor: "bundle" # either "bundle" or "cli-consumer"
        messages: 0 # amount of messages to process before restarting the consumer (only applicable for processor "bundle")
        compression: true # use compression (only applicable for processor "cli-consumer")
        worker: # http://supervisord.org/configuration.html#program-x-section-values
          count: 1
          startsecs: 0
          autorestart: true
          stopsignal: "INT"
          stopasgroup: true
          stopwaitsecs: 60
      individual:
        # my_consumer:
          # see general configuration
    rpc_servers: # see consumers

Example configuration

rabbit_mq_manager:
    consumers:
      general:
        processor: "bundle"
        messages: 1 # only consume 1 message before quiting/restarting
        worker: # http://supervisord.org/configuration.html#program-x-section-values
          count: 1
      individual:
        my_consumer:
          messages: 0 # don't restart "my_consumer" after consuming messages
          worker:
              count: 8 # start 8 listeners/processors for "my_consumer"
        my_other_consumer:
          processor: "cli-consumer"
          compression: true
          worker:
            count: 4