2017 © Pedro Peláez
 

symfony-bundle rabbitmq-manager-bundle

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

image

myonlinestore/rabbitmq-manager-bundle

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

  • Thursday, September 14, 2017
  • by Sm0ke0ut
  • Repository
  • 7 Watchers
  • 0 Stars
  • 12,862 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 49 % Grown

The README.md

RabbitMqManagerBundle

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads, (*1)

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., (*2)

Installation

Require the bundle and its dependencies with composer:, (*3)

$ composer require myonlinestore/rabbitmq-manager-bundle

Register the bundle into your app/AppKernel.php:, (*4)

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

Usage

All configuration options are optional., (*5)

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

The Versions