#[Asynchronous], #[CommandHandler]) integrate seamlessly with Laravel’s service container and event system.queue:work --partition=1), enabling horizontal scaling of consumers.event:dispatch() can trigger Kafka messages via Ecotone’s #[Asynchronous] handlers.php artisan queue:work) can process Kafka messages if configured as Ecotone consumers.#[Saga], #[EventSourced]) differs from Laravel’s traditional Bus/Dispatcher patterns.Illuminate\Support\SerializesModels.queue:work with Ecotone consumers requires rewiring job dispatching (e.g., #[Asynchronous] instead of dispatch(new Job)).#[Asynchronous] handlers to replace or extend Illuminate\Bus\Queueable.KafkaMessageReceived → Event::dispatch()).queue:work can process Ecotone consumers if configured as Kafka listeners.rbn/confluent-kafka-php.KafkaConnection (similar to Laravel’s Redis/DB config).ecotone_outbox). Laravel’s migrations can scaffold this.ecotone_events) is needed.#[Asynchronous] handlers.#[Asynchronous]
class ProcessOrder implements CommandHandler {
public function __invoke(ProcessOrderCommand $command) {
// Logic here
}
}
AppServiceProvider:
$this->app->bind(KafkaConnection::class, fn() => new KafkaConnection([
'bootstrap.servers' => env('KAFKA_BROKERS'),
]));
Schema::create('ecotone_outbox', function (Blueprint $table) {
$table->id();
$table->string('topic');
$table->json('payload');
$table->timestamps();
});
Bus to bridge Laravel jobs to Kafka.Mockery may need adjustments for #[Asynchronous] handlers.composer.json:
"ecotone/kafka": "^1.0"
config/app.php:
'providers' => [
Ecotone\Kafka\KafkaServiceProvider::class,
],
orders.created).ecotone:consumers:failed).acks, retries) must be documented to avoid misconfigurations.enable.auto.commit=false in consumers can cause offset loss.KAFKA_BROKERS env vars).Whoops or Telescope.How can I help you explore Laravel packages today?