PHPackages                             niladalia/rabbit-messenger-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. niladalia/rabbit-messenger-bundle

ActiveSymfony-bundle

niladalia/rabbit-messenger-bundle
=================================

A simple Symfony bundle that says 'Hello, World!'

14PHP

Since Oct 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/niladalia/rabbit-messenger-bundle)[ Packagist](https://packagist.org/packages/niladalia/rabbit-messenger-bundle)[ RSS](/packages/niladalia-rabbit-messenger-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Rabbit Messenger Bundle
=======================

[](#rabbit-messenger-bundle)

This repository contains a simple template for building event-driven microservices using the Rabbit Messenger Bundle.

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

[](#requirements)

You need to have a running RabbitMQ configuration or a Docker setup to use this bundle effectively.

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

[](#installation)

To integrate the Rabbit Messenger Bundle into your project, run the following command:

```
composer update niladalia/rabbit-messenger-bundle
```

Usage
=====

[](#usage)

Domain Events
-------------

[](#domain-events)

### Create Domain Events

[](#create-domain-events)

Your domain event classes should extend the `DomainEvent` class provided by the bundle:

```
namespace RabbitMessengerBundle\Domain\Event;

class YourDomainEvent extends DomainEvent {
    // Your event properties and methods
}
```

Publishing Events
-----------------

[](#publishing-events)

To publish events, inject the `DomainEventPublisherInterface` into the classes where you need to publish events. Call the `publish` method as shown below:

```
use RabbitMessengerBundle\Domain\Event\DomainEventPublisherInterface;

class YourService {
private $eventPublisher;

    public function __construct(DomainEventPublisherInterface $eventPublisher) {
        $this->eventPublisher = $eventPublisher;
    }

    public function someMethod() {
        $event = new YourDomainEvent(/* event data */);
        $this->eventPublisher->publish($event);
    }
}
```

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

[](#configuration)

### Messenger Configuration

[](#messenger-configuration)

In the `messenger.yaml` file of both your sender application and listener, specify the serializer as follows:

```
  serializer: RabbitMessengerBundle\Infrastructure\Serializer\MessengerSerializer
```

### Event Listener Configuration

[](#event-listener-configuration)

#### Implement the Domain Event Mapper

[](#implement-the-domain-event-mapper)

Your listener or receiver micro should implement the `DomainEventMapperInterface`.

This interface is responsible for mapping event types to the corresponding event classes in your microservice.

Your implementation must return an array with the following keys:

```
$map = [
    'aggregateId'
    'eventId'
    'attributes'
    'occurredOn'
];
```

It will also need to return a string with the full path for the domain event class of the recieved event from Rabbit.

#### Service Configuration

[](#service-configuration)

In the `services.yaml` file, specify the implementation for the `DomainEventMapperInterface` and ensure it is public:

```
App\Shared\Infrastructure\Event\DomainEventMapper:
    public: true  # Ensure the mapper is accessible

RabbitMessengerBundle\Domain\Event\Mapper\DomainEventMapperInterface: '@App\Shared\Infrastructure\Event\DomainEventMapper'
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/006df056f094b8aa99e2014cae24838dfdfa88dc7c7f6a13c68faaabeb55d279?d=identicon)[niladalia](/maintainers/niladalia)

---

Top Contributors

[![niladalia](https://avatars.githubusercontent.com/u/24969220?v=4)](https://github.com/niladalia "niladalia (3 commits)")

### Embed Badge

![Health badge](/badges/niladalia-rabbit-messenger-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/niladalia-rabbit-messenger-bundle/health.svg)](https://phpackages.com/packages/niladalia-rabbit-messenger-bundle)
```

PHPackages © 2026

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