Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eventsauce Messenger Laravel Package

andreo/eventsauce-messenger

Symfony Messenger integration for EventSauce. Dispatch and consume EventSauce messages via Messenger handlers, with optional autoconfiguration through the AsEventSauceMessageHandler attribute or manual service tagging. Requires PHP 8.2+ and Symfony Messenger 6.2+.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Event-Driven Architecture (EDA) in Laravel: Enables seamless integration of Symfony Messenger with EventSauce, allowing Laravel applications to adopt event sourcing and CQRS patterns without abandoning Laravel’s ecosystem. This supports roadmap items like migrating monolithic applications to microservices or implementing real-time data processing pipelines.
  • Decoupling and Modularity: Facilitates separation of event handling logic from business logic, improving maintainability and testability. Aligns with initiatives to adopt clean architecture, domain-driven design (DDD), or hexagonal architecture in Laravel projects.
  • Build vs. Buy Decision: Avoids reinventing the wheel for integrating EventSauce with Laravel’s messaging system, reducing development time and technical debt. Justifies using this package over custom middleware or third-party alternatives with higher maintenance costs.
  • Use Cases:
    • Real-time data processing: E.g., notifications, analytics, or fraud detection triggered by domain events.
    • Audit trails and compliance: Leveraging event sourcing to maintain immutable logs of system state changes.
    • Decoupled services: Enabling communication between Laravel services or microservices via events (e.g., order processing, inventory updates).
    • Projections and read models: Building optimized read models for complex queries using EventSauce’s event consumption capabilities.
    • Background job optimization: Replacing Laravel’s native queue system for event-driven workflows where ordering and replayability are critical.

When to Consider This Package

  • Adopt When:

    • Your Laravel application uses Symfony Messenger (via a bridge like spatie/laravel-messenger) and requires EventSauce for event sourcing or CQRS.
    • You need type-safe event handling with PHP 8.2+ and Laravel 10+ (or Symfony 6.2+).
    • Your architecture demands decoupled event consumers (e.g., projections, background jobs) without tight coupling to Laravel’s native queue system.
    • You prioritize autoconfiguration (via attributes) or manual configuration for flexibility in event handler registration.
    • Your use case involves union types for event handlers (e.g., handling multiple event types in a single consumer).
    • You are building a scalable, event-driven system where event replayability, auditability, or complex projections are required.
  • Look Elsewhere If:

    • You’re not using Symfony Messenger in your Laravel project (this package is tightly coupled to it).
    • Your PHP version is <8.2 or Laravel version is <10.x (or Symfony version is <6.2).
    • You need advanced EventSauce features (e.g., snapshotting, replaying events) that aren’t covered by this package’s scope or require custom extensions.
    • Your team prefers alternative messaging libraries (e.g., RabbitMQ, NATS, or Laravel’s native queue system) over Symfony Messenger.
    • You require enterprise-grade support (this package has minimal adoption; evaluate maintenance risks and community support).
    • Your project needs real-time event streaming (e.g., WebSockets) beyond Symfony’s middleware pipeline, and Laravel Echo or Pusher is already in use.
    • You are not using event sourcing and can achieve your goals with Laravel’s native illuminate/events or queue system.

How to Pitch It (Stakeholders)

For Executives:

*"This package enables us to build a scalable, event-driven architecture in Laravel by integrating Symfony Messenger with EventSauce. By adopting event sourcing, we can:

  • Improve auditability and compliance with immutable event logs for critical business processes.
  • Decouple services to enhance modularity, making it easier to scale and maintain our system.
  • Accelerate development by leveraging existing libraries (Symfony Messenger and EventSauce) instead of building custom solutions.
  • Future-proof our architecture for real-time data processing, microservices, or complex projections without vendor lock-in. The package is a low-risk adoption with minimal dependencies (PHP 8.2+, Laravel 10+), aligning with our tech stack while supporting long-term goals like regulatory compliance and scalability."*

For Engineering:

*"This solves a critical gap: how to dispatch EventSauce events through Symfony Messenger in Laravel without manual boilerplate. Key benefits:

  • Autoconfigured event handlers via attributes (e.g., [AsEventSauceMessageHandler]) or manual YAML tags, reducing setup time.
  • Union type support for handling multiple event types in one consumer (e.g., onOrderCreated|PaymentProcessed), improving code reuse.
  • Seamless middleware integration—just configure Symfony Messenger’s eventBus with the provided middleware in Laravel’s queue workers.
  • No vendor lock-in: Uses standard EventSauce consumers and Symfony Messenger, so we retain flexibility to switch components if needed. Trade-offs:
  • Early-stage package (0 stars, minimal adoption), but the code follows Symfony’s patterns and is well-documented.
  • Requires Symfony Messenger bridge (e.g., spatie/laravel-messenger) and PHP 8.2+, which may introduce compatibility challenges.
  • EventSauce integration adds complexity (e.g., event store setup, projections), but aligns with our event-driven roadmap. Recommendation: Pilot this in a non-critical feature (e.g., a projection or background job) to validate the integration before full adoption."*

For Product Managers:

*"This package supports our roadmap to modernize our event-driven workflows in Laravel. Here’s how it aligns with our goals:

  • Auditability: Event sourcing provides a complete, immutable history of system changes, critical for compliance and debugging.
  • Scalability: Decoupled event consumers enable horizontal scaling of services (e.g., notifications, analytics) without tight coupling.
  • Real-time Processing: Integrates with Symfony Messenger to enable async event handling, improving performance for high-throughput systems.
  • Future Flexibility: Allows us to adopt microservices or complex projections without rewriting core infrastructure. Next Steps:
  1. Assess feasibility with the engineering team for a pilot (e.g., implementing event sourcing for order processing).
  2. Evaluate trade-offs (e.g., Symfony dependency, EventSauce setup) against alternatives like Laravel’s native queue system.
  3. Align with stakeholders on priorities (e.g., compliance, scalability) to justify the investment."*

Call to Action:

  • Engineering: Prototype the integration in a sandbox project or non-critical feature to validate performance, compatibility, and developer experience.
  • Product: Prioritize use cases where event sourcing or CQRS provides clear value (e.g., audit logs, real-time analytics).
  • Architecture: Document the integration path (Symfony Messenger bridge, EventSauce setup) and dependencies for future teams.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
graham-campbell/flysystem
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi