Repository: https://github.com/uzapoint/eventbus-core
# Uzapoint 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 uzapoint/eventbus-corePublish configuration:
php artisan vendor:publish --tag=eventbus-configExample:
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,
],
];use Uzapoint\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": { ... }
}Run:
php artisan eventbus:consumeOptions:
php artisan eventbus:consume --queue=auth_ms.business_events
php artisan eventbus:consume --exchange=business.eventsPrevents duplicate event execution.
Configured via:
'idempotency' => [
'enabled' => true,
'ttl' => 3600,
'redis_prefix' => 'event:processed:',
],Detect slow events:
'monitoring' => [
'enabled' => true,
'slow_event_threshold' => 5000, // ms
],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
- PHP 8.4+
- Laravel 11 / 12+
- RabbitMQ
- Redis
MIT
Sammy Orondo Lead Developer — Uzapoint https://github.com/sammy-boy