ceedcv-maya/shared-messaging-laravel

RabbitMQ messaging layer for Laravel: typed event publishers (audit, logs, notifications, alerts), reusable consumer base, retry/DLX handling.
1,009
Install
composer require ceedcv-maya/shared-messaging-laravel
Latest Version:v0.23.0
PHP:^8.4
Laravel:11 · 12 · 13
License:MIT
Last Updated:Oct 15, 2026
Links: GitHub  ·  Packagist
Maintainer: GGEdu

ceedcv-maya/shared-messaging-laravel

RabbitMQ messaging layer for Laravel: typed event publishers (audit, logs, notifications, alerts), reusable consumer base, retry/DLX handling, resilient retry-on-disconnect.

Part of the ceedcv-maya/maya_platform mono-repo. Distributed independently for reuse outside the Maya ecosystem.

Estándar de mensajería

Este paquete es el cliente obligatorio del estándar de mensajería Maya (messaging/ESTANDAR.md en el monorepo maya_platform): exchanges, colas (config('messaging.queues.*')), claves de enrutado y permisos salen del catálogo messaging/topology.yaml. El test MessagingStandardTest falla si la configuración del paquete y el catálogo divergen.

Installation

composer require ceedcv-maya/shared-messaging-laravel

Quick start

use Maya\Messaging\Publishers\AuditPublisher;

AuditPublisher::dispatch([
    'app' => 'orders',
    'action' => 'create',
    'entity_type' => 'order',
    'entity_id' => $order->id,
    'user_id' => auth()->id(),
]);

Configuration:

RABBITMQ_HOST=rabbitmq.example.org
RABBITMQ_USER=guest
RABBITMQ_PASS=guest

Features

Publishers (Audit, Logs, Notifications, Alerts)

Type-safe message dispatch for cross-app event ingestion. Each publisher validates payload shape and routes to its exchange (maya.audit, maya.logs, etc.).

Resilient retry on RabbitMQ disconnect

When RabbitMQ is unavailable, RetryAmqpPublishJob buffers failed publishes using Laravel's queue system with exponential backoff:

  • Queue connection: Configured via messaging.retry.connection. Defaults to:
    • database in development (if default queue is rabbitmq)
    • Your app's default queue in production (typically Redis)
  • Retry policy: 5 attempts with backoff [30s, 60s, 120s, 300s, 600s] (~17 min total)
  • Excluded: LogPublisher (high volume, disk-backed already)

Configure in config/messaging.php:

'retry' => [
    'connection' => 'database',  // or 'redis', null for app default
],

See RetryAmqpPublishJob.php for implementation.

Consumer base

Reusable ConsumeQueueCommand for building app-specific consumers with the same error handling and ACK policy (see maya_logs, maya_audit, maya_dashboard).

TypeScript / build notes

PSR-4 autoload from src/. Service providers are registered via Laravel package discovery (no manual provider registration needed).

License

MIT — see LICENSE.

Reporting issues

The canonical source lives in Maya-AQSS/maya_platform. File issues there; this read-only split repo is only the published artifact.

Related Packages

lettermint/laravel-rabbitmq

A RabbitMQ queue driver for Laravel with explicit topology, publisher confirms,...

6,031 3
avto-dev/amqp-rabbit-laravel-queue

RabbitMQ laravel queue driver

37,045 9
ahloul/rabbitevents-mod

Laravel back-to-back broadcasting events. It uses RabbitMQ as the transport.

28,196 0
butik/rabbitevents

Laravel back-to-back broadcasting events. It uses RabbitMQ as the transport.

2,165 0

Version History

Version Released PHP Laravel License
v0.23.0 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.22.2 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.22.1 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.22.0 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.21.0 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT