PHPackages                             interactive-solutions/zf-bernard - 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. interactive-solutions/zf-bernard

AbandonedArchivedLibrary[Queues &amp; Workers](/categories/queues)

interactive-solutions/zf-bernard
================================

1.2.4(8y ago)33.5k21MITPHPPHP ^7.0.0

Since Mar 23Pushed 8y ago2 watchersCompare

[ Source](https://github.com/interactive-solutions/zf-bernard)[ Packagist](https://packagist.org/packages/interactive-solutions/zf-bernard)[ Docs](https://github.com/interactives-solutions/zf-bernard)[ RSS](/packages/interactive-solutions-zf-bernard/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (1)Versions (19)Used By (1)

ZF-Bernard
==========

[](#zf-bernard)

[![Code Quality](https://camo.githubusercontent.com/f6e1727b9af28c82b3fa9dbe68e3f50a12f63544f25186631b93473f1d081924/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e7465726163746976652d736f6c7574696f6e732f7a662d6265726e6172642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://camo.githubusercontent.com/f6e1727b9af28c82b3fa9dbe68e3f50a12f63544f25186631b93473f1d081924/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e7465726163746976652d736f6c7574696f6e732f7a662d6265726e6172642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)[![Build status](https://camo.githubusercontent.com/59ae1f28da276176bf620aa1c849d3a7a8f09faf37642355c978fed3cced9928/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e7465726163746976652d736f6c7574696f6e732f7a662d6265726e6172642f6261646765732f6275696c642e706e673f623d6d6173746572)](https://camo.githubusercontent.com/59ae1f28da276176bf620aa1c849d3a7a8f09faf37642355c978fed3cced9928/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e7465726163746976652d736f6c7574696f6e732f7a662d6265726e6172642f6261646765732f6275696c642e706e673f623d6d6173746572)

Provides zend framework 2, 3 and zend-expressive integrations

Installing
----------

[](#installing)

We support installation via composer, note for now you need to set the minimum stability to alpha to install

`composer require interactive-solutions/zf-bernard`

Usage
-----

[](#usage)

To consume a queue:

```
$ php public/index interactive-solutions:bernard:consume
```

You can also pass the following options:

- `--max-runtime=`: This will make the consumer shutdown after `` seconds. PHP\_INT\_MAX by default
- `--stop-on-failure`: This will make the consumer halt on unhandled exceptions. Off by default
- `--max-messages=`: This will make the consumer shutdown after `` messages are ran. Infinite by default
- `--stop-on-empty`: This will make the consumer run all the queued messages and then shutdown. Off by default

Normalizers
-----------

[](#normalizers)

You can add any normalizer that you wish to use by adding it to the `BernardOptions::enabledNormalizers`

The default enabled normalizers are

- `Bernard\Normalizer\DefaultMessageNormalizer`
- `Bernard\Normalider\EnvelopeNormalizer`
- `InteractiveSolutions\Bernard\Normalizer\ExplicitNormalizer`

Add to the queue
----------------

[](#add-to-the-queue)

Create an object extending the `AbstractExplicitMessage` class and it to the producer queue like this:

```
final class SomeClass
{
    // This method is called when the task is consumed
    public function __invoke(Message $message)
    {
        // do stuff
    }
}

final class Message extends AbstractExplicitMessage
{
    // various parameters for your application

    /**
     * Message constructor.
     */
    public function __construct(...parameters)
    {
        // Initialize parameters
    }

    /**
     * @return string
     */
    public function getName()
    {
        return SomeClass::class;
    }

    // getters for your parameters

    public function getQueue(): string
    {
        return 'some-queue';
    }
}

$producer->produce(new Message(...parameters));
```

Register the `SomeClass` under `bernard_consumer_manager` in the config and you're done.

Hooking into the event manager using a delegate factory
-------------------------------------------------------

[](#hooking-into-the-event-manager-using-a-delegate-factory)

This delegate factory supports both zend framework service manager 2 &amp; 3, read more about it [here](https://zendframework.github.io/zend-servicemanager/migration/#factories)

Example of introducing the ClearObjectManager event listener

```
final class EventDispatcherDelegateFactory implements DelegatorFactoryInterface
{
    public function __invoke(ContainerInterface $container, $requestedName, callable $callback, array $options = null)
    {
        /* @var $dispatcher EventDispatcherInterface */
        $dispatcher = $callback();
        $dispatcher->addListener(BernardEvents::ACKNOWLEDGE, $container->get(ClearObjectManager::class));

        return $dispatcher;
    }

    public function createDelegatorWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName, $callback)
    {
        return $this($serviceLocator, $requestedName, $callback);
    }
}
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 83% 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 ~42 days

Recently: every ~35 days

Total

15

Last Release

3162d ago

Major Versions

0.0.8 → 1.0.02016-07-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/825f7193bec88275f660c65faab1790ed620948f5dd7a6c96515d1f12609127d?d=identicon)[mac\_nibblet](/maintainers/mac_nibblet)

---

Top Contributors

[![awartoft](https://avatars.githubusercontent.com/u/1127626?v=4)](https://github.com/awartoft "awartoft (39 commits)")[![noggan](https://avatars.githubusercontent.com/u/7058221?v=4)](https://github.com/noggan "noggan (5 commits)")[![Hotas2k](https://avatars.githubusercontent.com/u/1724484?v=4)](https://github.com/Hotas2k "Hotas2k (3 commits)")

### Embed Badge

![Health badge](/badges/interactive-solutions-zf-bernard/health.svg)

```
[![Health](https://phpackages.com/badges/interactive-solutions-zf-bernard/health.svg)](https://phpackages.com/packages/interactive-solutions-zf-bernard)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M30](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6045.5M513](/packages/illuminate-bus)[bernard/bernard-bundle

Integrates Bernard into a Symfony2 application.

95694.9k3](/packages/bernard-bernard-bundle)[bernard/juno

Web application for Bernard. Offers introspection, api and monitoring.

531.2k](/packages/bernard-juno)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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