Ecotone 将重点放在业务代码上。为了实现这一目标,在 PHP 中支持基于 DDD、CQRS 和事件源的消息驱动架构。
To contribute make use of Ecotone-Dev repository.
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.
…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:
#[Asynchronous('notifications')] routes to RabbitMQ, SQS, Kafka, Redis, or DBALExtract a specific flow and test it in isolation — only the services you need:
$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:
$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.
| 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 |
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
composer require ecotone/symfony-bundleSymfony Messenger compatible. Bundle auto-configuration. Doctrine ORM integration. Pure POPOs. → Symfony guide
Laravel
composer require ecotone/laravelWorks with Eloquent and Doctrine. Laravel Queue integration. Auto-discovery, zero config. → Laravel guide
Any PSR-11 framework (Ecotone Lite)
composer require ecotone/ecotoneFull feature set. No framework lock-in. → Ecotone Lite guide
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.
https://docs.ecotone.tech/~gitbook/mcp — Install in VSCodeLearn more: AI Integration Guide
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.
Use issue tracking system for new feature request and bugs. Please verify that it's not already reported by someone else.
If you want to talk or ask questions about Ecotone
If you want to help building and improving Ecotone consider becoming a sponsor:
PHP, DDD, CQRS, Event Sourcing, Sagas, Projections, Durable Workflows, Durable Execution, Workflows, Orchestrator, Outbox, Symfony, Laravel, Service Bus, Event Driven Architecture
暂无开放 Issues,或尚未同步最近议题。