simple-bus/symfony-bridge
Symfony integration bridge for SimpleBus/MessageBus. Provides CommandBusBundle, EventBusBundle, and DoctrineORMBridgeBundle to wire command and event buses into your Symfony app, with docs and upgrade guide.
DoctrineORMBridgeBundle suggests potential for event persistence (e.g., storing events in a database for replayability), which could be adapted in Laravel via Doctrine DBAL or Eloquent events.Bus facade as a facade over SimpleBus).Event facade for event buses.CommandBusBundle with a custom facade or Laravel’s Bus (if using laravel-bus).ContainerAware handlers).DoctrineORMBridgeBundle would require Doctrine DBAL or a custom adapter for Laravel’s ORM.ContainerInterface) for this bridge, or will we abstract them away?CommandBusBundle with a custom facade wrapping SimpleBus’s CommandBus, injecting handlers via Laravel’s service container.Event facade to dispatch events, with SimpleBus handling asynchronous processing (e.g., via queues).doctrine/dbal) instead of the full ORM to avoid Eloquent conflicts.ContainerAware handlers with Laravel’s container-aware closures.Event system, using queued listeners for async processing.DoctrineORMBridgeBundle to use DBAL or build a custom Laravel event store.events:dispatch or Bus::dispatch.config.yml → Laravel’s config/bus.php.RedisQueue, DatabaseQueue).app()->bind() to register SimpleBus components.| Step | Task | Dependencies | Risks |
|---|---|---|---|
| 1 | Set up SimpleBus core (simple-bus/message-bus) |
PHP 8.0+ | Version conflicts |
| 2 | Create Laravel facade for CommandBus |
Laravel 8.0+ | Container binding issues |
| 3 | Register command handlers | Existing Laravel services | Handler compatibility |
| 4 | Integrate event bus with Laravel events | Event facade |
Async event handling |
| 5 | (Optional) Adapt Doctrine ORM bridge | Doctrine DBAL | ORM complexity |
| 6 | Test with real commands/events | Queue workers | Performance bottlenecks |
Bus facade for simpler debugging than Symfony’s CommandBus.artisan queue:work for bus processing.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Queue Worker Crash | Unprocessed commands/events | Use Laravel’s queue retries and dead letter queues |
| Handler Exception | Failed command/event | Implement SimpleBus middleware for logging/retry |
| Database Locking (Doctrine) | Event persistence failures | Use optimistic locking or queue-based retries |
| Symfony-Laravel Abstraction Leak | Fragile code | Isolate SimpleBus in a separate service layer |
| Stale Package | Security/bug vulnerabilities | Monitor for forks or build a Laravel-specific fork |
How can I help you explore Laravel packages today?