ecotone-identifier-mapping

Maps identifiers to route commands and events to aggregates or sagas.

2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/ecotoneframework/skills --skill ecotone-identifier-mapping
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecotone-identifier-mapping
Source: https://github.com/ecotoneframework/skills/tree/main/skills/ecotone-identifier-mapping
Command: npx skills add https://github.com/ecotoneframework/skills --skill ecotone-identifier-mapping

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about ecotone-identifier-mapping

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I route commands to the correct aggregate by identifier in Ecotone?

Route commands to the correct aggregate by identifier in Ecotone using native property name mapping, the aggregate.id metadata override, or the #[TargetIdentifier] attribute to map differently named properties. This ensures commands reach the correct aggregate instance for processing.

Can I map event payload properties to a saga identifier using expressions?

Map event payload or header properties to a saga identifier using the identifierMapping configuration with expressions. This resolves saga identifiers dynamically from incoming messages to route events to the correct saga instance.

Does Ecotone support computed identifiers for aggregate routing?

Ecotone supports computed identifiers for aggregate routing using the #[IdentifierMethod] attribute. This allows you to calculate identifier values dynamically instead of relying on direct property mapping, enabling complex routing scenarios for aggregates and sagas.

Can I combine identifierMapping and identifierMetadataMapping on the same Ecotone handler?

You cannot combine identifierMapping and identifierMetadataMapping on the same Ecotone handler. Explicit constraints prevent using both identifier resolution approaches simultaneously, requiring you to choose either payload expressions or header-based mapping for routing.

How do composite keys work when routing events to an Ecotone saga?

Composite keys for routing events to an Ecotone saga work by defining multiple identifiers on the handler. This allows resolving routing targets using a combination of identifier values extracted from the incoming message payload or headers.

What is the best way to override default aggregate routing in Ecotone?

The best way to override default aggregate routing in Ecotone is using the aggregate.id metadata override. This forces command routing to a specific aggregate by setting the identifier metadata directly on the message, bypassing native property name mapping.