- How does this package differ from Laravel’s built-in queue system for background jobs?
- This package uses SimpleBus for asynchronous messaging, offering more advanced features like command/query separation, sagas, and event sourcing patterns. Laravel’s queues are simpler and better for basic job processing, while this package adds abstraction for complex workflows or distributed systems.
- Can I use this alongside Laravel’s native queues, or does it replace them?
- It can run parallel to Laravel’s queues, but you’ll need to manage potential conflicts like duplicate processing. The package doesn’t natively integrate with Laravel’s queue workers, so you’d need custom solutions for unified monitoring or retries.
- What Laravel versions does this package support, and are there PHP requirements?
- The package requires PHP 8.0+ and is designed for Laravel 8+. Check the SimpleBus version compatibility, as older Laravel releases may need adjustments for service container integration.
- How do I set up SimpleBus handlers and message buses in Laravel?
- You’ll need to configure SimpleBus in a Laravel Service Provider, binding components like message buses and handlers to the container. The package likely provides helpers, but you may need to define custom middleware for retries, logging, or error handling.
- Does this package support Laravel’s failed_jobs table for error tracking?
- No, it relies on SimpleBus’s own error handling. Failed messages may need custom logging or integration with Laravel’s failed_jobs via middleware, depending on your setup.
- What backends does SimpleBus support for message storage (e.g., Redis, database)?
- SimpleBus supports multiple backends like Redis, Doctrine, and AMQP. You can configure it to use Laravel’s Redis or database drivers, but ensure your chosen backend aligns with Laravel’s storage configurations.
- Is there a performance overhead compared to Laravel’s queues for simple tasks?
- Yes, SimpleBus adds abstraction layers, which may introduce slight overhead for basic async tasks. Laravel’s queues are optimized for simplicity, while this package shines in complex workflows like event sourcing or distributed systems.
- How do I migrate existing Laravel jobs to use this package?
- You’ll need to rewrite jobs as SimpleBus messages or commands. The package likely provides adapters, but incremental migration may require careful planning to avoid breaking existing workflows.
- Are there alternatives to this package for async messaging in Laravel?
- Yes—Laravel’s native queues, Spatie’s Laravel Background Jobs, or packages like Laravel Horizon for Redis-based queues. This package is unique for SimpleBus integration but adds complexity if you don’t need its advanced features.
- How do I monitor message processing, latency, or failures in production?
- SimpleBus provides logging and metrics, but you’ll need to extend it for Laravel-specific observability. Consider integrating with Laravel’s logging or tools like Sentry for centralized monitoring of failed messages.