ecotone/enqueue
Adapter layer between Ecotone and the Enqueue messaging abstraction. Usually installed via Ecotone transport packages (AMQP, Redis, SQS). Install directly only to build custom Enqueue-backed transports and integrate with Ecotone channels and consumers.
#[CommandHandler], #[EventHandler]), which could modernize Laravel’s event/queue systems for complex workflows.Illuminate\Queue and Ecotone’s sagas/outbox.redis, database) with SQS/AMQP while preserving existing job payloads via adapters.#[CommandHandler]) may require team upskilling, especially for Laravel devs accustomed to simpler queue jobs.queue:work support: Requires custom worker scripts (e.g., Supervisor/Kubernetes).Illuminate\Contracts\Queue\Job may not align with Ecotone’s payload format. Needs adapter layer.failed_jobs table or retry-after logic.Event::dispatch() must be mapped to Ecotone’s EventBus, which may require wrapper classes.dispatch()) sufficient?queue:failed or Horizon?pusher/php-server, or Symfony Messenger) with lower risk?redis, database) but provides a unified API for brokers like SQS or AMQP.| Phase | Action | Tools/Libraries | Risk |
|---|---|---|---|
| Assessment | Benchmark Laravel’s native queues vs. Ecotone + Enqueue for throughput/latency. | phpbench, blackfire.io, Laravel Debugbar |
Low |
| Pilot | Replace a non-critical queue (e.g., email sending) with Ecotone + SQS. | Ecotone Lite, Laravel’s Queue facade, AWS SQS |
Medium (isolated failure) |
| Core Integration | Migrate event publishing (Event::dispatch()) to Ecotone’s #[EventHandler]. |
Ecotone’s EventBus, Enqueue adapter, custom event wrapper |
High (logic changes) |
| Queue Worker Adaptor | Build a custom queue worker to replace php artisan queue:work. |
Supervisor, ecotone/enqueue, Laravel Service Provider |
High (operational change) |
| Advanced Patterns | Adopt sagas/outbox for complex workflows (e.g., order processing). | Ecotone’s Saga, Outbox modules, database transactions |
High (team learning curve) |
| Full Replacement | Replace all Illuminate\Queue usage with Ecotone’s Bus. |
Custom queue worker, ecotone/enqueue, serialization adapters |
Critical |
queue:work support.Bus and deploy via Supervisor or Kubernetes Jobs.php artisan ecotone:consume --queue=default --worker=supervisor
Illuminate\Contracts\Queue\Job vs. Ecotone’s message format.// Example adapter
class LaravelJobToEcotoneMessageAdapter
{
public function adapt(JobInterface $job): Message
{
return new Message(
json_encode($job->payload()),
['headers' => $job->resolveName()]
);
}
}
failed_jobs table.RetryPolicy alongside Laravel’s queue:failed table or implement a custom failed job handler.Event::dispatch() vs. Ecotone’s EventBus.class LaravelEventBridge
{
public function dispatch($event)
{
$bus->dispatch(new EcotoneEvent($event));
}
}
.env vs. Ecotone’s configuration.$this->app->singleton(EcotoneBus::class, function ($app) {
return new EcotoneBus(
new EnqueueConnection($app['config']['ecotone.broker'])
);
});
EventBus.Event::dispatch() calls.How can I help you explore Laravel packages today?