PHPackages                             michelv/rabbitmq-scaler-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. michelv/rabbitmq-scaler-bundle

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

michelv/rabbitmq-scaler-bundle
==============================

Provides a command to scale RabbitMq consumers up when the need arises.

v1.1.1(9y ago)022MITPHPPHP &gt;=5.3.0

Since Nov 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/michelv/RabbitMqScalerBundle)[ Packagist](https://packagist.org/packages/michelv/rabbitmq-scaler-bundle)[ RSS](/packages/michelv-rabbitmq-scaler-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

RabbitMqScalerBundle
====================

[](#rabbitmqscalerbundle)

Provides a command to launch RabbitMq consumers when the need arises.

About
-----

[](#about)

The RabbitMqScalerBundle extends php-amqplib's RabbitMqBundle by adding a command that handles launching your consumers when they are needed.

```
$ ./app/console michelv:rabbitmq:scaler your_queue
```

Every N seconds (default is N=10), the command will check whether there are enough workers to handle the number of messages in the given queue.

The command inherits from rabbitmq:consumer, so that any argument for that command will be applied to the command that launches a consumer.

Consumers are launched, but not terminated. This is something that can be done automatically by setting a connection timeout in your consumer's configuration, or by specifying a number of messages to handle using the `--messages` option.

Installation
------------

[](#installation)

Require the bundle and its dependencies with composer:

```
$ composer require michelv/rabbitmq-scaler-bundle=dev-master
```

Register the bundle and the bundle that it depends on:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new RCH\ConfigAccessBundle\RCHConfigAccessBundle(),
        new Michelv\RabbitMqScalerBundle\MichelvRabbitMqScalerBundle(),
    );
}
```

Configuration
-------------

[](#configuration)

### Queue options

[](#queue-options)

The command will regularly query the RabbitMQ server for the state of the queue being consumed. For this purpose, it needs to know the exact options that you have set up with php-amqplib's RabbitMqBundle.

For example, with the following configuration:

```
old_sound_rabbit_mq:
    ...
    consumers:
        upload_picture:
            connection:       default
            exchange_options: {name: 'upload-picture', type: direct}
            queue_options:    {name: 'upload-picture'}
            callback:         upload_picture_service
```

You will need to add this configuration:

```
michelv_rabbit_mq_scaler:
    consumers:
        upload_picture:
            queue_options:    {name: 'upload-picture'}
```

### Defaults for the command

[](#defaults-for-the-command)

You can change the defaults in your configuration file.

The defaults are defined thusly:

```
michelv_rabbit_mq_scaler:
    debug: '%kernel.debug%'
    min_consumers: 1
    max_consumers: 10
    messages: 10
    interval: 10
    iterations: 0
    command: 'rabbitmq:consumer'
    prefix: ''
    log: '/dev/null'
    consumer_service_pattern: 'old_sound_rabbit_mq.%s_consumer'
```

Examples
--------

[](#examples)

No consumers when there are no tasks, a maximum amount of 20 consumers, check every 5 seconds:

```
$ ./app/console michelv:rabbitmq:scaler --min 0 --max 20 --interval 5 your_queue
```

Default settings, but each consumer must handle at most 50 messages, or quit when they have used over 100 MB of RAM:

```
$ ./app/console michelv:rabbitmq:scaler --messages 50 --memory-limit 100 your_queue
```

Default settings, but each consumer is niced, and the command will stop after 10 iterations:

```
$ ./app/console michelv:rabbitmq:scaler --prefix 'nice -n 15' --iterations 10 your_queue
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

4

Last Release

3514d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/356225?v=4)[michel v](/maintainers/michelv)[@michelv](https://github.com/michelv)

---

Top Contributors

[![michelv](https://avatars.githubusercontent.com/u/356225?v=4)](https://github.com/michelv "michelv (8 commits)")

---

Tags

messageSymfony2queuerabbitmqAMQP

### Embed Badge

![Health badge](/badges/michelv-rabbitmq-scaler-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/michelv-rabbitmq-scaler-bundle/health.svg)](https://phpackages.com/packages/michelv-rabbitmq-scaler-bundle)
```

###  Alternatives

[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.2k20.7M68](/packages/php-amqplib-rabbitmq-bundle)[bunny/bunny

Performant pure-PHP AMQP (RabbitMQ) non-blocking ReactPHP library

7466.7M42](/packages/bunny-bunny)[pdezwart/php-amqp

PHP AMQP Binding Library

585245.5k2](/packages/pdezwart-php-amqp)[php-amqp/php-amqp

PHP AMQP Binding Library

58510.4k](/packages/php-amqp-php-amqp)[kdyby/rabbitmq

Integrates php-amqplib with RabbitMq and Nette Framework

27715.0k4](/packages/kdyby-rabbitmq)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
