PHPackages                             sammy-boy/eventbus-core - 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. sammy-boy/eventbus-core

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

sammy-boy/eventbus-core
=======================

Reusable event bus infrastructure for Laravel microservices

v1.0.2(3mo ago)2194MITPHPPHP ^8.4

Since Feb 6Pushed 3mo agoCompare

[ Source](https://github.com/sammy-boy/eventbus-core)[ Packagist](https://packagist.org/packages/sammy-boy/eventbus-core)[ Docs](https://github.com/sammy-boy/eventbus-core)[ RSS](/packages/sammy-boy-eventbus-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Repository:

---

```
# SammyBoy EventBus Core

Reusable, opinionated Event Bus infrastructure for Laravel microservices.

Built for scalable, event-driven architectures using RabbitMQ and Redis-backed idempotency.

---

## Features

- Standardized event envelope (meta + data)
- Automatic idempotency protection (Redis)
- RabbitMQ publisher with confirmations
- Config-driven consumer
- Dead Letter Exchange support
- Slow-event monitoring
- Laravel auto-discovery support
- Production-ready defaults with flexibility

---

## Installation

```bash
composer require sammy-boy/eventbus-core
```

---

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

[](#configuration)

Publish configuration:

```
php artisan vendor:publish --tag=eventbus-config
```

Example:

```
return [

    'exchanges' => [
        'auth.events',
        'business.events',
    ],

    'queues' => [
        [
            'name' => 'auth_ms.business_events',
            'exchange' => 'business.events',
            'routing_keys' => [
                'tenant.registration.initiated',
            ],
        ],
    ],

    'handlers' => [
        'tenant.registration.initiated' => ProcessTenantCreation::class,
    ],

];
```

---

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

[](#publishing-events)

```
use SammyBoy\EventBus\RabbitMQService;

$eventBus->publish(
    exchange: 'business.events',
    routingKey: 'tenant.registration.initiated',
    data: [
        'auth_user_id' => 12,
        'email' => 'user@example.com',
    ]
);
```

Envelope automatically becomes:

```
{
  "meta": {
    "id": "...",
    "type": "tenant.registration.initiated",
    "source": "auth-service",
    "timestamp": "...",
    "correlation_id": "..."
  },
  "data": { ... }
}
```

---

Consuming Events
----------------

[](#consuming-events)

Run:

```
php artisan eventbus:consume
```

Options:

```
php artisan eventbus:consume --queue=auth_ms.business_events
php artisan eventbus:consume --exchange=business.events
```

---

Idempotency
-----------

[](#idempotency)

Prevents duplicate event execution.

Configured via:

```
'idempotency' => [
    'enabled' => true,
    'ttl' => 3600,
    'redis_prefix' => 'event:processed:',
],
```

---

Monitoring
----------

[](#monitoring)

Detect slow events:

```
'monitoring' => [
    'enabled' => true,
    'slow_event_threshold' => 5000, // ms
],
```

---

Architecture Philosophy
-----------------------

[](#architecture-philosophy)

Opinionated but flexible.

This package enforces:

- Standardized event structure
- Config-driven topology
- Explicit handler mapping

But allows:

- Custom queue naming
- Custom exchanges
- Retry behavior overrides
- Dead-letter configuration
- Performance tuning

---

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

[](#requirements)

- PHP 8.4+
- Laravel 11 / 12+
- RabbitMQ
- Redis

---

License
-------

[](#license)

MIT

---

Author
------

[](#author)

Sammy Orondo Lead Developer — SammyBoy

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance81

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

3

Last Release

101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fef7a98f1d5fbe8afc6bc97bdb902cfdc17667fc98b41b9c26d6f2622cc072bf?d=identicon)[sammy-boy](/maintainers/sammy-boy)

---

Tags

laravelevent-drivenrabbitmqevent busmicroservicessammy-boy

### Embed Badge

![Health badge](/badges/sammy-boy-eventbus-core/health.svg)

```
[![Health](https://phpackages.com/badges/sammy-boy-eventbus-core/health.svg)](https://phpackages.com/packages/sammy-boy-eventbus-core)
```

###  Alternatives

[nuwber/rabbitevents

The Nuwber RabbitEvents package

120515.8k3](/packages/nuwber-rabbitevents)[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)[iamfarhad/laravel-rabbitmq

A robust RabbitMQ driver for Laravel Queue with advanced message queuing, reliable delivery, and high-performance async processing capabilities

3215.6k](/packages/iamfarhad-laravel-rabbitmq)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[mookofe/tail

RabbitMQ and PHP client for Laravel and Lumen that allows you to add and listen queues messages just simple

5552.5k](/packages/mookofe-tail)

PHPackages © 2026

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