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

Eventor Symfony Laravel Package

becklyn/eventor-symfony

Minimal pub/sub abstraction for Symfony, with built-in support for Dapr’s Pub/Sub API. Configure via env vars and publish typed messages to topics, then register handlers and expose simple subscription and topic endpoints through a controller/registry.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pub/Sub Abstraction: The package provides a clean abstraction for pub/sub operations, aligning well with event-driven architectures (e.g., microservices, CQRS, or domain-driven design). It decouples event production/consumption from broker-specific logic, enabling vendor-agnostic event handling.
  • Symfony/Laravel Compatibility: While ported for Symfony, the core logic (e.g., Publisher, Subscriber, serialization) is framework-agnostic. Laravel’s dependency injection (DI) and HTTP stack (e.g., route handling) can accommodate the package with minor adaptations (e.g., replacing Symfony’s AbstractController with Laravel’s Controller).
  • Dapr Focus: The package is tightly coupled to Dapr’s Pub/Sub API, limiting flexibility if other brokers (e.g., RabbitMQ, Kafka, Redis) are needed. This may require custom broker adapters or a wrapper layer.

Integration Feasibility

  • Low-Coupling Design: The package enforces separation of concerns (e.g., Publisher vs. Subscriber), making it easier to integrate without monolithic changes.
  • HTTP Endpoints: Subscription handling relies on HTTP endpoints (e.g., /dapr/pubsubname/topic), which Laravel’s routing system can support. However, Laravel’s middleware pipeline (e.g., auth, validation) may need to be manually integrated into the subscription flow.
  • Serialization: Uses Symfony’s Serializer component (compatible with Laravel via symfony/serializer). Laravel’s native JSON serialization could conflict; explicit configuration may be needed.

Technical Risk

  • Breaking Changes: Recent versions (e.g., 3.0.0) introduce breaking changes (e.g., uncaught subscriber exceptions). Laravel integrations must account for error handling strategies (e.g., retry logic, dead-letter queues).
  • Dapr Dependency: Requires Dapr sidecar or standalone runtime. Laravel deployments (e.g., shared hosting, serverless) may lack Dapr support, necessitating alternative broker configurations.
  • Observability: OpenTelemetry tracing (added in 2.0.0) is not natively supported in Laravel. Integration would require additional packages (e.g., laravel-telemetry) or custom instrumentation.
  • Lack of Laravel-Specific Docs: No examples or guides for Laravel; assumptions about Symfony’s AbstractController or FrameworkBundle may not translate directly.

Key Questions

  1. Broker Strategy:
    • Is Dapr a hard requirement, or is broker flexibility needed? If not Dapr, can the package be extended to support other brokers (e.g., via interfaces)?
  2. Error Handling:
    • How should subscriber failures be managed (e.g., retries, DLQs)? The package’s 3.0.0 change (uncaught exceptions) may require custom middleware.
  3. Serialization:
    • Will Laravel’s default JSON serialization conflict with Symfony’s Serializer? If so, how will this be resolved (e.g., service binding)?
  4. Observability:
    • Is OpenTelemetry tracing required? If yes, how will it be integrated with Laravel’s existing monitoring (e.g., Laravel Telescope, Prometheus)?
  5. Deployment:
    • How will Dapr be deployed (sidecar, standalone)? Are there constraints (e.g., Kubernetes, serverless) that affect integration?
  6. Testing:
    • Are there existing tests for the package? How can they be adapted for Laravel’s testing stack (e.g., Pest, PHPUnit)?

Integration Approach

Stack Fit

  • Laravel Compatibility:
    • DI Container: Laravel’s container can replace Symfony’s FrameworkBundle for service registration. The Publisher and DaprSubscriptionRegistry can be bound as singletons.
    • Routing: Replace Symfony’s #[Route] annotations with Laravel’s Route::post() or controller methods. Middleware (e.g., auth, CORS) can be wrapped around subscription endpoints.
    • HTTP Foundation: Laravel’s Request and Response classes are compatible with the package’s handleTopic() method.
  • Broker Abstraction:
    • The package’s Publisher interface can be extended to support non-Dapr brokers (e.g., RabbitMQPublisher). A facade pattern (e.g., EventPublisher) could unify the API.
  • Serialization:
    • Override Symfony’s Serializer with Laravel’s JsonSerializable or use a shared service (e.g., Symfony\Component\Serializer\Serializer).

Migration Path

  1. Proof of Concept (PoC):
    • Implement a minimal publisher/subscriber pair in a Laravel app using Dapr.
    • Test serialization, error handling, and routing.
  2. Adapter Layer:
    • Create Laravel-specific abstractions (e.g., LaravelPublisher, LaravelSubscriber) to handle framework differences (e.g., routing, middleware).
  3. Broker Extension:
    • If Dapr is not mandatory, implement additional broker adapters (e.g., KafkaPublisher) using the package’s interfaces.
  4. Observability:
    • Integrate OpenTelemetry with Laravel’s existing stack (e.g., spatie/laravel-otel) or replace tracing with Laravel-compatible alternatives (e.g., monolog).
  5. Error Handling:
    • Build middleware to catch subscriber exceptions and route them to a DLQ or retry mechanism.

Compatibility

  • Symfony Dependencies:
    • The package requires symfony/framework-bundle (v6.1+) and symfony/serializer. Laravel can include these via Composer, but conflicts may arise with Laravel’s native components (e.g., illuminate/support). Use replace in composer.json to avoid version conflicts.
  • Laravel-Specific Features:
    • Service Providers: Register the package’s services in Laravel’s AppServiceProvider or a dedicated EventorServiceProvider.
    • Middleware: Wrap subscription endpoints with Laravel middleware (e.g., ValidateSignatureMiddleware for Dapr).
    • Events: Leverage Laravel’s event system to bridge between the package’s pub/sub and Laravel’s native events (e.g., Event::dispatch()).

Sequencing

  1. Setup Dapr:
    • Deploy Dapr sidecar or standalone instance and configure the pub/sub component.
  2. Install Package:
    • Add becklyn/eventor-symfony to composer.json and resolve Symfony dependency conflicts.
  3. Configure Services:
    • Bind the Publisher and DaprSubscriptionRegistry in Laravel’s container.
  4. Implement Publishers:
    • Create Laravel services to publish events using the Publisher.
  5. Implement Subscribers:
    • Define subscriber handlers and route Dapr’s HTTP callbacks to Laravel controllers.
  6. Add Middleware:
    • Integrate auth, validation, or retry logic around subscription endpoints.
  7. Test:
    • Validate pub/sub flows, error handling, and serialization.
  8. Monitor:
    • Integrate tracing (if required) and logging.

Operational Impact

Maintenance

  • Dependency Management:
    • The package has no dependents and low stars, indicating limited community support. Maintenance risks include:
      • Unpatched vulnerabilities in Symfony dependencies.
      • Lack of updates for PHP/Laravel version compatibility (last release: 2022).
    • Mitigation: Fork the package or create a Laravel-specific fork to backport fixes.
  • Breaking Changes:
    • The package’s history shows breaking changes (e.g., error handling in 3.0.0). Laravel integrations must account for version pinning and backward compatibility layers.
  • Documentation:
    • Minimal documentation (README, release notes). Laravel-specific guides or internal runbooks will be necessary.

Support

  • Debugging:
    • Dapr-specific issues (e.g., connection errors, serialization failures) may require cross-team collaboration between Laravel and Dapr/Symfony experts.
    • Tools: Use Dapr’s CLI (dapr) and Laravel’s telescope for debugging pub/sub flows.
  • Vendor Lock-in:
    • Tight coupling to Dapr may limit support options. Alternative brokers could reduce lock-in but require additional development.
  • Community:
    • No active community (0 stars, 0 dependents). Support may rely on the original maintainer or internal resources.

Scaling

  • Performance:
    • Dapr’s Pub/Sub API is designed for microservices but may introduce latency. Benchmark publisher/subscriber throughput under load.
    • Bottlenecks: HTTP-based subscriptions (e.g., handleTopic) could become a bottleneck. Consider:
      • Async processing (e.g., Laravel queues) for heavy subscribers.
      • Dapr’s native async subscribers (if supported).
  • Horizontal Scaling:
    • Laravel’s stateless nature aligns with Dapr’s scaling model. Ensure:
      • Subscription endpoints are idempotent and stateless.
      • Load balancers route Dapr’s HTTP callbacks to all Laravel instances (if using multiple workers).
  • Resource Usage:
    • Monitor memory/CPU usage during high-throughput scenarios (e.g., bursty events). Symfony’s Serializer may add overhead.

Failure Modes

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui