What problem does it solve?
Implements identifier mapping for Ecotone aggregates and sagas: native ID resolution, aggregate.id metadata, #[TargetIdentifier], identifierMapping expressions, and #[IdentifierMethod]. Use when wiring commands/events to aggregates or sagas by identifier, resolving aggregate IDs from messages, or mapping event properties to saga identifiers.
Core Features & Use Cases
- Declarative identifiers with #[Identifier] on aggregates and sagas
- Native mapping by property name (automatic if it matches the identifier)
- aggregate.id metadata override to force routing
- #[TargetIdentifier] to map differently named properties
- identifierMapping for expressions from payload or headers
- identifierMetadataMapping for header-based identifier resolution
- identifier also supports #[IdentifierMethod] for computed values
- Support for composite keys via multiple identifiers
- Distinct rules preventing combining identifierMapping and identifierMetadataMapping on the same handler
Quick Start
Define identifier mappings on handlers (such as identifierMapping or identifierMetadataMapping) and emit an event or command to verify routing to the correct aggregate or saga by its identifier.