PHPackages                             mmi/mmi-event-consumer - 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. [API Development](/categories/api)
4. /
5. mmi/mmi-event-consumer

ActiveLibrary[API Development](/categories/api)

mmi/mmi-event-consumer
======================

MMi Event Consumer with MMi Framework

1.0.11(1mo ago)07.0k↓37.5%MITPHPCI passing

Since May 27Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/milejko/mmi-event-consumer)[ Packagist](https://packagist.org/packages/mmi/mmi-event-consumer)[ RSS](/packages/mmi-mmi-event-consumer/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (6)Versions (12)Used By (0)

mmi-event-consumer
==================

[](#mmi-event-consumer)

PHP library providing a message consumer abstraction for AMQP-compatible message brokers (RabbitMQ), built on the MMi Framework.

Features
--------

[](#features)

- Clean `MessageConsumerInterface` for consuming messages
- AMQP implementation (`AmqpMessageConsumer`) using `php-amqplib`
- Null implementation (`NullMessageConsumer`) for testing/disabling
- PHP-DI integration with environment variable configuration

Requirements
------------

[](#requirements)

- PHP 8.4 or 8.5
- Composer
- `ext-amqp` PHP extension

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

[](#installation)

```
composer require mmi/mmi-event-consumer
```

Quick Start
-----------

[](#quick-start)

1. Include the DI configuration in your application:

```
// In your PHP-DI config
return [
    // ... your config
    ...include 'vendor/mmi/mmi-event-consumer/src/MmiEventConsumer/di.consumer.php',
];
```

2. Set environment variables:

```
MMI_CONSUMER_QUEUE_ENABLED=true
MMI_CONSUMER_QUEUE_HOST=rabbitmq
MMI_CONSUMER_QUEUE_PORT=5672
MMI_CONSUMER_QUEUE_VHOST=/
MMI_CONSUMER_QUEUE_USERNAME=guest
MMI_CONSUMER_QUEUE_PASSWORD=guest
```

3. Inject and use:

```
use MmiEventConsumer\MessageConsumerInterface;

class MyService
{
    public function __construct(
        private MessageConsumerInterface $consumer
    ) {}

    public function start(): void
    {
        $this->run(function ($message) {
            // Process message
        });
    }
}
```

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

[](#configuration)

VariableDefaultDescription`MMI_CONSUMER_QUEUE_ENABLED``false`Enable/disable the AMQP consumer`MMI_CONSUMER_QUEUE_HOST``localhost`RabbitMQ host`MMI_CONSUMER_QUEUE_PORT``5672`RabbitMQ port`MMI_CONSUMER_QUEUE_VHOST``''`RabbitMQ virtual host`MMI_CONSUMER_QUEUE_USERNAME``''`RabbitMQ username`MMI_CONSUMER_QUEUE_PASSWORD``''`RabbitMQ passwordDevelopment
-----------

[](#development)

### Setup

[](#setup)

```
git clone
cd mmi-event-consumer
composer install
```

### Docker

[](#docker)

```
docker build --build-arg PHP_VERSION=8.5 -t mmi-event-consumer .
docker run mmi-event-consumer sh -c "composer test:all"
```

### Testing

[](#testing)

```
# Run all checks (security, PHPCS, PHPStan, PHPMD, PHPUnit)
composer test:all

# Run PHPUnit only
composer test:phpunit

# Static analysis (level 8)
composer test:phpstan

# Code style check
composer test:phpcs

# Mess detection
composer test:phpmd

# Security check
composer test:security-checker
```

### Code Fixing

[](#code-fixing)

```
# Run all fixers
composer fix:all

# PHP Code Beautifier
composer fix:phpcbf

# PHP-CS-Fixer
composer fix:php-cs-fixer
```

### Reports

[](#reports)

```
# Generate PHPMetrics HTML report
composer report:metrics
# Output: web/build/metrics/
```

Coverage reports are generated in:

- HTML: `web/build/phpunit/`
- Clover: `.phpunit.coverage.clover.xml`

Code Quality Standards
----------------------

[](#code-quality-standards)

- **Coding Standard**: PSR2 (PHP\_CodeSniffer)
- **Static Analysis**: PHPStan level 8
- **Mess Detection**: PHPMD (Clean Code, Code Size, Design, etc.)
- **Security**: Dependency vulnerability checking

CI/CD
-----

[](#cicd)

GitHub Actions runs on pull requests and pushes:

- Tests against PHP 8.4 and 8.5
- Builds Docker image and runs `composer test:all`

Project Structure
-----------------

[](#project-structure)

```
src/MmiEventConsumer/
├── AmqpMessageConsumer.php      # RabbitMQ consumer implementation
├── MessageConsumerInterface.php # Consumer interface
├── NullMessageConsumer.php      # Null object implementation
└── di.consumer.php              # PHP-DI configuration

tests/
└── Unit/MmiEventConsumer/
    └── NullMessageConsumerTest.php

```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Recently: every ~269 days

Total

11

Last Release

51d ago

### Community

Maintainers

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

---

Top Contributors

[![milejko](https://avatars.githubusercontent.com/u/14335568?v=4)](https://github.com/milejko "milejko (19 commits)")

---

Tags

mmimmi-event-consumer

### Embed Badge

![Health badge](/badges/mmi-mmi-event-consumer/health.svg)

```
[![Health](https://phpackages.com/badges/mmi-mmi-event-consumer/health.svg)](https://phpackages.com/packages/mmi-mmi-event-consumer)
```

###  Alternatives

[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2822.5M7](/packages/bschmitt-laravel-amqp)

PHPackages © 2026

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