simple-bus/asynchronous-bundle
Symfony bundle for asynchronous command/event handling with SimpleBus. Integrates async middleware and message dispatching so work can be queued and processed later. Part of the SimpleBus ecosystem; docs and issue tracking in the main repository.
DependencyInjection, EventDispatcher) enable partial integration, but native Laravel queue systems (e.g., queue:work) may conflict or require workarounds.database, redis, beanstalkd) handle async tasks natively. SimpleBus adds message-driven abstraction but requires:
serialize) between SimpleBus and Laravel’s payload format.failed_jobs table vs. SimpleBus’s storage).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Deprecated Package | High | Last release in 2016; evaluate forks (e.g., Symfony Messenger) or alternatives like Laravel Horizon. |
| Queue Driver Conflicts | Medium | Test serialization/deserialization between SimpleBus and Laravel’s queue adapters (e.g., Redis, database). |
| Lack of Laravel Features | Medium | Extend SimpleBus with Laravel-specific listeners (e.g., Illuminate\Bus\QueueingDispatcher) or use it only for message routing. |
| Performance Overhead | Low | Benchmark against native Laravel queues for throughput and latency. |
| Maintenance Burden | Medium | Document custom bridge logic; plan for migration if SimpleBus becomes unsustainable. |
failed_jobs table)?// Dispatch a SimpleBus message
$message = new ProcessOrderMessage($orderId);
$this->bus->dispatch($message);
// Bridge to Laravel queue (custom logic)
Queue::push(new ProcessOrderJob($orderId));
OrderProcessedEvent).// app/Handlers/ProcessOrderHandler.php
class ProcessOrderHandler implements MessageHandlerInterface {
public function handle(ProcessOrderMessage $message) {
// Business logic here
}
}
| Component | Compatibility Notes |
|---|---|
| Laravel Queues | Requires custom adapters to move messages between SimpleBus and Laravel’s queue drivers. |
| Symfony Components | Works natively with DependencyInjection, EventDispatcher, etc. |
| Message Serialization | Must align with Laravel’s queue payload format (e.g., JSON, PHP serialize). |
| Database Queues | Potential schema conflicts if using Laravel’s queue:table vs. SimpleBus’s storage. |
| Redis Queues | Feasible but requires custom serialization (e.g., JSON for SimpleBus messages). |
| Laravel Events | SimpleBus messages can trigger Laravel events, but vice versa may need listeners. |
interface ProcessOrderMessage {
public function getOrderId(): string;
}
composer require simple-bus/asynchronous-bundle
public function register() {
$this->mergeConfigFrom(__DIR__.'/../config/simple_bus.php', 'simple_bus');
$this->app->register(SimpleBusAsynchronousBundle::class);
}
// app/Listeners/SimpleBusToQueueListener.php
public function handle($message) {
Queue::push(new LaravelJob($message->getData()));
}
queue:failed table won’t natively track SimpleBus messages.failed_jobs table via a listener.How can I help you explore Laravel packages today?