Skip to content

Latest commit

 

History

History

README.md

description Tempest CQRS DDD Event Sourcing with Ecotone

Tempest

Ecotone integrates with your existing Tempest application — Tempest active-record models for aggregate persistence and your Tempest database connection reused for DBAL (outbox, event sourcing, multi-tenant). You keep Tempest's modern, attribute-first developer experience and add enterprise messaging architecture.

The same Ecotone code — aggregates, #[CommandHandler], sagas, projections — runs on Tempest exactly as it does on Laravel, Symfony or Ecotone Lite.

Installation

Follow Installation menu.

{% hint style="success" %} By design, Ecotone auto-discovers Attributes in the PSR-4 roots of your Tempest application (for example App\) — no configuration file is required, and the CommandBus, QueryBus and EventBus gateways are injectable anywhere in your app.

If you want to override what is scanned, provide a namespaces configuration. {% endhint %}

Tempest Services in your Handlers

Handler parameters resolve from Tempest's container, including services provided through Tempest initializers — so framework services like the Mailer inject directly:

use Tempest\Mail\GenericEmail;
use Tempest\Mail\Mailer;

#[Asynchronous('notifications')]
#[EventHandler(endpointId: 'order_confirmation.notify')]
public function sendConfirmation(OrderWasPlaced $event, Mailer $mailer): void
{
    $mailer->send(new GenericEmail(
        subject: sprintf('Order #%d confirmed', $event->orderId),
        to: $event->customerEmail,
        html: '...',
    ));
}

Combined with a durable channel, this is asynchronous email sending in one attribute.

Materials

Live demo application

A full e-commerce shop built on Tempest + Ecotone — browsable UI, CQRS, a Tempest model as the Aggregate, async workers, event sourcing with a projection, an email workflow ending in a local Mailpit inbox, retries with a replayable dead letter, delayed messages, and the outbox running by construction:

Demo implementation