Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

ecotone

> 后端框架
Open source

Ecotone shifts the focus to the business code. In order to make it happen, enables Message-Driven Architecture with DDD, CQRS, Event Sourcing in PHP.

568 stars0 likes0 views
WebsiteGitHub

About

Ecotone shifts the focus to the business code. In order to make it happen, enables Message-Driven Architecture with DDD, CQRS, Event Sourcing in PHP.

This is Read Only Repository

To contribute make use of Ecotone-Dev repository.

Ecotone — the PHP architecture layer that grows with your system, without rewrites

From #[CommandHandler] on day one, to event sourcing, sagas, outbox, and distributed messaging at scale — one package, same codebase, no forced migrations between growth stages. Declarative PHP 8 attributes on the classes you already have. No base classes, no bus wiring, no retry config.

Built on Enterprise Integration Patterns — the same pattern language behind Spring Integration, Axon, NServiceBus, and Apache Camel — brought to PHP as attribute-driven code.

Visit ecotone.tech for the full overview.


See what it looks like

…

That's the entire setup. No bus configuration. No handler registration. No retry config. No serialization wiring. Ecotone reads your attributes and handles the rest:

  • Command, Query, and Event Bus — wired automatically from your attributes
  • Event routing — handlers subscribe to events without manual wiring
  • Async execution — #[Asynchronous('notifications')] routes to RabbitMQ, SQS, Kafka, Redis, or DBAL
  • Failure isolation — each event handler gets its own copy of the message, so one handler's failure never blocks another
  • Retries and dead letter — failed messages retry automatically; permanently failed ones go to a dead letter queue you can inspect and replay
  • Tracing — OpenTelemetry traces every message across sync and async flows

Test exactly the flow you care about

Extract a specific flow and test it in isolation — only the services you need:

php
$ecotone = EcotoneLite::bootstrapFlowTesting([OrderService::class]);

$ecotone->sendCommand(new PlaceOrder('order-1'));

$this->assertEquals('placed', $ecotone->sendQueryWithRouting('order.getStatus', 'order-1'));

Only OrderService is loaded — no notifications, no other handlers. Just the flow you're verifying.

Now bring in the full async flow. Enable an in-memory channel and run it inside the same test process:

php
$notifier = new InMemoryNotificationSender();

$ecotone = EcotoneLite::bootstrapFlowTesting(
    [OrderService::class, NotificationService::class],
    [NotificationSender::class => $notifier],
    enableAsynchronousProcessing: [
        SimpleMessageChannelBuilder::createQueueChannel('notifications')
    ]
);

$ecotone
    ->sendCommand(new PlaceOrder('order-1'))
    ->run('notifications');

$this->assertEquals(['order-1'], $notifier->getSentOrderConfirmations());

Swap the in-memory channel for DBAL, RabbitMQ, or Kafka in production — the test stays the same. Ecotone runs the consumer in-process, so switching transports never changes how you test.


What's in the box

Area What you get Deep dive
Messaging Command / Query / Event buses, routing, interceptors, business interfaces (gateways) docs
Domain modelling Aggregates, Sagas, state-stored or event-sourced — all via attributes ecotone.tech/domain-driven-design
Event Sourcing Event Store, Projections (catch-up, partitioned, streaming), event versioning and upcasting, snapshots ecotone.tech/event-sourcing
Durable Workflows Stateless workflows, sagas, orchestrators (routing slip), event-sourced sagas with full replay — long-running processes that survive crashes, deploys, and restarts on the DB + broker you already run ecotone.tech/durable-workflows
Asynchronous communication #[Asynchronous], message channels, delayed messages, scheduling, priority, TTL, dynamic channels ecotone.tech/asynchronous-communication
Resiliency Retries, error channels, dead letter queue with replay, Outbox pattern, deduplication docs
Orchestration EIP routing, splitters, filters, transformers, multi-step orchestrators (Enterprise) ecotone.tech/orchestration-layer
Observability OpenTelemetry tracing, Service Map (Enterprise) docs
Multi-tenancy Per-tenant connections, event stores, and async channels docs
Distribution Distributed Bus for cross-service events and commands ecotone.tech/microservices
Data protection Field-level encryption and PII masking for messages docs
Testing EcotoneLite::bootstrapFlowTesting — full flows in-process, no broker required docs

Install for your framework

Ecotone is not a replacement for Symfony Messenger or Laravel Queue — it's the architecture layer on top. Your existing HTTP layer, transports, and jobs keep working.

Symfony

bash
composer require ecotone/symfony-bundle

Symfony Messenger compatible. Bundle auto-configuration. Doctrine ORM integration. Pure POPOs. → Symfony guide

Laravel

bash
composer require ecotone/laravel

Works with Eloquent and Doctrine. Laravel Queue integration. Auto-discovery, zero config. → Laravel guide

Any PSR-11 framework (Ecotone Lite)

bash
composer require ecotone/ecotone

Full feature set. No framework lock-in. → Ecotone Lite guide


AI-Ready by design

Declarative attributes mean less infrastructure code for your coding agent to read and less boilerplate for it to generate — smaller context, faster iteration, more accurate results.

  • MCP Server: https://docs.ecotone.tech/~gitbook/mcp — Install in VSCode
  • Agentic Skills — ready-to-use skills that teach any coding agent to correctly write handlers, aggregates, sagas, projections, and tests
  • LLMs.txt: ecotone.tech/llms.txt
  • Context7: Available via @upstash/context7-mcp

Learn more: AI Integration Guide


Getting started

See the quickstart guide, the full documentation, and the Ecotone Blog.

Prefer runnable code? The quickstart examples cover handlers, aggregates, sagas, event sourcing, projections, outbox, multi-tenancy, and more — each running end-to-end in seconds.

Feature requests and issue reporting

Use issue tracking system for new feature request and bugs. Please verify that it's not already reported by someone else.

Contact

If you want to talk or ask questions about Ecotone

  • Twitter
  • [email protected]
  • Community Channel

Support Ecotone

If you want to help building and improving Ecotone consider becoming a sponsor:

  • Sponsor Ecotone
  • Contribute to Ecotone.

Tags

PHP, DDD, CQRS, Event Sourcing, Sagas, Projections, Durable Workflows, Durable Execution, Workflows, Orchestrator, Outbox, Symfony, Laravel, Service Bus, Event Driven Architecture

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPcqrsdddecotoneevent-sourcing

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架