PHPackages                             rezzza/command-bus-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. [CLI &amp; Console](/categories/cli)
4. /
5. rezzza/command-bus-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

rezzza/command-bus-bundle
=========================

rezzza/command-bus integration to Symfony

3.3.3(8y ago)536.8k9[1 issues](https://github.com/rezzza/command-bus-bundle/issues)MITPHPPHP &gt;=5.5.0

Since Oct 6Pushed 4y ago6 watchersCompare

[ Source](https://github.com/rezzza/command-bus-bundle)[ Packagist](https://packagist.org/packages/rezzza/command-bus-bundle)[ Docs](https://github.com/rezzza/command-bus-bundle)[ RSS](/packages/rezzza-command-bus-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

RezzzaCommandBusBundle
======================

[](#rezzzacommandbusbundle)

Integration of the [**CommandBus**](http://github.com/rezzza/command-bus) library into Symfony2.

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

[](#installation)

Require [`rezzza/command-bus-bundle`](https://packagist.org/packages/rezzza/command-bus-bundle)to your `composer.json` file:

```
{
    "require": {
        "rezzza/command-bus-bundle": "~2.0"
    }
}
```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Rezzza\CommandBusBundle\RezzzaCommandBusBundle()
    );
}
```

Update your `config.yml`:

```
framework:
    serializer:
        enabled: true
```

Usage
-----

[](#usage)

```
$bus = $container->get('rezzza_command_bus.command_bus.synchronous'); // synchronous is the name you given to your bus in configuration.
$bus->handle(new FooCommand());
```

Bus
---

[](#bus)

Direct, SncRedis &amp; OldSoundRabbit are currently supported.

Commands
--------

[](#commands)

Commands must inherit from `Rezzza\CommandBus\Domain\CommandInterface`.

Register a command handler:

```

```

Events
------

[](#events)

Events:

```
- on_consumer_response
- pre_handle_command

```

Register a listener:

```

```

Fail Strategy
-------------

[](#fail-strategy)

See [command-bus documentation](https://github.com/rezzza/command-bus#fail-strategies).

Console Command
---------------

[](#console-command)

A Symfony console command is provided in this bundle

```
$ app/console rezzza:command_bus:consume "CommandToConsume"

Options available:

 --consumer             Which consumer should we use ? (default: "default")
 --iteration-limit (-i) Limit of iterations, -1 for infinite.. (default: -1)
 --time-limit           During how many time this command will listen to the queue. (default: 60)
 --usleep               Micro seconds (default: 100000)
 --lock                 Only one command processing ?

```

To watch activity of your consumer, you should register a console handler for monolog

```
monolog:
    handlers:
        console:
            type:   console
            verbosity_levels:
                VERBOSITY_NORMAL: NOTICE
```

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

[](#configuration)

```
rezzza_command_bus:
    buses:
      synchronous: direct
      asynchronous:
        rabbitmq:
          #define producer_guesser which allow to determine rigth producer for each command
          #producer name and command class name must be indentical
            #example:
            #producer name : source_entry_update
            #command class name : SourceEntryUpdateCommand
          producer_guesser: rezzza_command_bus.old_sound_rabbit.producer_guesser
          consumer_bus: synchronous #consumer handle command with synchronous bus
        snc_redis:
            client: default # snc redis client.
            read_block_timeout: 1 # see blpop documentation
            consumers:
                default:
                    bus: synchronous
                    fail_strategy:
                        retry_then_fail: # When the command fail, it uses this strategy.
                        # you could use too requeue, none, service.
                            attempts: 10
                            requeue_on_fail: true
    handlers: # Do you want to use handlers provided in this bundle ?
        retry:  synchronous  # If you used retry_then_fail strategy, this handler is linked to Retry commands.
        failed: synchronous # If you used retry_then_fail strategy, this handler is linked to Failed commands.
```

Usage with JMS Serializer
-------------------------

[](#usage-with-jms-serializer)

```
rezzza_command_bus:
    logger_normalizer: symfony_serializer

services:
    symfony_serializer:
        class: "Symfony\Component\Serializer\Serializer"
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~58 days

Recently: every ~49 days

Total

12

Last Release

3237d ago

Major Versions

v1.0.2 → v2.02016-01-15

v2.0.1 → v3.0.02016-02-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/47c3006a9e7662031ee9d3fa064238fef88479fd7d60f18dd47f038fbbd7dc5a?d=identicon)[steph\_py](/maintainers/steph_py)

---

Top Contributors

[![stephpy](https://avatars.githubusercontent.com/u/232744?v=4)](https://github.com/stephpy "stephpy (24 commits)")[![tyx](https://avatars.githubusercontent.com/u/245494?v=4)](https://github.com/tyx "tyx (18 commits)")[![shouze](https://avatars.githubusercontent.com/u/54712?v=4)](https://github.com/shouze "shouze (6 commits)")[![ScullWM](https://avatars.githubusercontent.com/u/1017746?v=4)](https://github.com/ScullWM "ScullWM (2 commits)")[![mtrudu](https://avatars.githubusercontent.com/u/10370955?v=4)](https://github.com/mtrudu "mtrudu (1 commits)")

---

Tags

bundlecommandbus

### Embed Badge

![Health badge](/badges/rezzza-command-bus-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/rezzza-command-bus-bundle/health.svg)](https://phpackages.com/packages/rezzza-command-bus-bundle)
```

###  Alternatives

[shapecode/cron-bundle

This bundle provides scheduled execution of Symfony commands

59493.0k2](/packages/shapecode-cron-bundle)[laminas/laminas-cli

Command-line interface for Laminas projects

563.7M54](/packages/laminas-laminas-cli)[flyingfoxx/commandcenter

Commands and domain events for any framework. Includes a Laravel implementation.

152.2k](/packages/flyingfoxx-commandcenter)

PHPackages © 2026

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