PHPackages                             wisembly/amqp-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. wisembly/amqp-bundle

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

wisembly/amqp-bundle
====================

Alternative for SwarrotBundle to handle amqp in Symfony2 applications

v2.1.7(7y ago)34.2k3[2 issues](https://github.com/Wisembly/AMQPBundle/issues)[1 PRs](https://github.com/Wisembly/AMQPBundle/pulls)MITPHPPHP ^7.1

Since Apr 3Pushed 7y ago5 watchersCompare

[ Source](https://github.com/Wisembly/AMQPBundle)[ Packagist](https://packagist.org/packages/wisembly/amqp-bundle)[ RSS](/packages/wisembly-amqp-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (11)Versions (34)Used By (0)

Amqp Swarrot Bundle
===================

[](#amqp-swarrot-bundle)

This bundle integrates Swarrot into Symfony, with another approach from the [SwarrotBundle](http://github.com/swarrot/SwarrotBundle). Currently in early stages of development... and opensourcing.

But, unlike the SwarrotBundle, this bundle does not allow you (...yet ?) to configure multiple consumers, and force you to use the `CommandProcessor`approach (Every message should be treated in the `CommandProcessor`, which will be treated through a Symfony `Process`).

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

[](#installation)

The recommended way is to go through Composer. Once you have installed it, you should run the require command: `composer require wisembly\amqp-bundle`, and pick the latest version available on packagist (you should avoid `@stable`meta-constraint). Note that a flex recipe is available. :}

Configuration Reference
-----------------------

[](#configuration-reference)

The configuration reference can be found through the command `app/console config:dump-reference WisemblyAmqpBundle` :

```
# Default configuration for extension with alias: "wisembly_amqp"
wisembly_amqp:

    # Default connection to use
    default_connection:   null

    # Broker to use
    broker:               ~ # Required

    # Path to sf console binary
    console_path:         ~ # Required

    # Logger channel to use when a logger is required
    logger_channel:       amqp

    # Connections to AMQP to use
    connections:          # Required

        # Prototype
        name:
            uri:                  null
            host:                 null
            port:                 null
            login:                null
            password:             null
            vhost:                null
            query:                null

    # Access gate for each dialog with AMQP
    gates:

        # Prototype
        name:

            # Does the queue and the exchange be declared before use them
            auto_declare:         true

            # Connection to use with this gate
            connection:           null

            # Routing key to use when sending messages through this gate
            routing_key:          null

            # Queue to fetch the information from
            queue:                # Required
                name:                 ~ # Required
                options:
                    passive:              false
                    durable:              true
                    exclusive:            false
                    auto_delete:          false
                    arguments:

                        # Prototype
                        name:                 ~

            # Exchange point associated to this gate
            exchange:             # Required
                name:                 ~ # Required
                options:
                    type:                 null
                    passive:              false
                    durable:              true
                    auto_delete:          false
                    internal:             false
                    arguments:

                        # Prototype
                        name:                 ~
```

Usage
-----

[](#usage)

### Concept of "Gates"

[](#concept-of-gates)

This concept is the whole difference with the Swarrot Bundle : Gates. It is a simple value object containing information on the queue / exchange to use for your actions (which connection to use, which queue it should target, which exchange should be used, which routing key, ... and configuration for these, such as should the exchange / queue be declared if not existent, and so on).

Refer to the configuration reference for more information on what is possible to configure for a "gate". Once you have at least one, you can consume from one, or publish to one. For that, see below.

### Publishing a Message

[](#publishing-a-message)

You may publish a new message to a gate (access point). For that, you should retrieve the services `Wisembly\AmqpBundle\GatesBag` to fetch the right gate, and then use the `Wisembly\AmqpBundle\Publisher` service to publish a message that can be understood by the `CommandProcessor` :

```
use Wisembly\AmqpBundle\Message;
use Wisembly\AmqpBundle\Publisher;

$message = new Message(
    'symfony:command:to:run',
    [
        'list',
        'of',
        'arguments'
        'and'
        'options'
    ]
]));

// Using swarrot's Swarrot\Broker\Message is also possible if you don't plan on
// consuming the message through the provider consumer

$publisher->publish($message, 'my_gate');
// or $publisher->publish($message, $gate); with `$gate` an instanceof Gate
```

Your message is then ready to be consumed by the consumer. But, if you don't want to use the AmqpBundle's consumer, you're not forced to use the same syntax and use whatever you need !

### Consuming a Message

[](#consuming-a-message)

In order to consume the messages that are expected by this bundle, all you have to do is run the following command :

```
php app/console wisembly:amqp:consume gate

```

A bunch of options are available (such as activating a RPC mechanism, defining a polling interval, ...), but you can check all of those in the `--help` option.

Whenever a message is consumed by this consumer, it will launch a new `Process`to treat it, and will pass the environment and verbosity to the command that is run. The output will then be retrieved and printed on the consumer's output.

### Implementing a Broker

[](#implementing-a-broker)

Two brokers are built-in :

- The `Wisembly\AmqpBundle\Broker\PeclBroker` ([php amqp extension](https://pecl.php.net/package/amqp)) Note that if the pecl extension is not loaded / installed, the broker won't be available.
- [`Wisembly\AmqpBundle\Broker\PhpAmqpLibBroker`](https://github.com/php-amqplib/php-amqplib), which is the one implemented in full PHP

The recommended broker is to use if available the `Wisembly\AmqpBundle\Broker\PeclBroker` broker.

But you can implement more of those (such as a Redis one or whatever else !) by implementing the `Wisembly\AmqpBundle\BrokerInterface` interface. If using the `autoconfigure` setting of the dic 3.4+, that's all you have to do. If you want to add an alias or if not using the `autoconfigure` feature, you can add a `wisembly.amqp.broker` tag, which can have an alias (it will take the service's name if no alias are specified).

Credits
-------

[](#credits)

Developed with love at the Wisembly Factory, based on the [SwarrotBundle](http://github.com/swarrot/SwarrotBundle).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 84% 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 ~13 days

Recently: every ~29 days

Total

33

Last Release

2907d ago

Major Versions

v1.4.2 → v2.02017-12-13

v1.4.4 → v2.0.22017-12-13

v1.4.5 → v2.0.42017-12-13

v1.4.6 → v2.0.82017-12-27

PHP version history (2 changes)v1.2PHP ^7.0

v1.4PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0a8e7ce68ae5cfe2ad58504dffc6d4e5ca05291dcde032048a70c3f8e9e7e3a?d=identicon)[Talus](/maintainers/Talus)

---

Top Contributors

[![Taluu](https://avatars.githubusercontent.com/u/239685?v=4)](https://github.com/Taluu "Taluu (173 commits)")[![krichprollsch](https://avatars.githubusercontent.com/u/562696?v=4)](https://github.com/krichprollsch "krichprollsch (30 commits)")[![guillaumepotier](https://avatars.githubusercontent.com/u/496234?v=4)](https://github.com/guillaumepotier "guillaumepotier (2 commits)")[![rgazelot](https://avatars.githubusercontent.com/u/1488251?v=4)](https://github.com/rgazelot "rgazelot (1 commits)")

---

Tags

amqpbrokerconsumerphpsymfony

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wisembly-amqp-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/wisembly-amqp-bundle/health.svg)](https://phpackages.com/packages/wisembly-amqp-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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