ecotone-handler

Create Ecotone message handlers with routing, endpoints, and metadata.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Ecotone developers often face inconsistent patterns when creating message handlers. This skill provides a unified approach to declare and wire CommandHandler, EventHandler, QueryHandler, and ServiceActivator with correct endpointIds, routing, and metadata.

Core Features & Use Cases

  • Class-based routing: Use type-hinted message classes to route to handlers automatically.
  • Routing-key flexibility: Annotate with a string-based routing key for integration scenarios.
  • Endpoint configuration: Enforce unique endpointId per handler and ensure proper output channels.
  • Header metadata access: Use #[Header] to read message headers in handlers.
  • Documentation & examples: See API references and usage examples for ready-to-copy patterns.

Quick Start

Create a sample OrderService with CommandHandler, EventHandler, and QueryHandler annotated methods to demonstrate routing and endpointId usage.

Frequently Asked Questions about ecotone-handler

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

FAQPage Schema
How do I create an Ecotone message handler with correct routing and endpoint configuration?

To create an Ecotone message handler, you apply Ecotone attributes like CommandHandler, EventHandler, QueryHandler, or ServiceActivator to class methods. This ensures consistent endpointIds, proper routing, and correct metadata wiring for your messages.

What is the difference between class-based routing and routing-key patterns in Ecotone?

Class-based routing in Ecotone uses type-hinted message classes to automatically route messages to handlers. Routing-key patterns use string-based keys for integration scenarios, offering flexibility when class auto-routing is not applicable.

Do I need PHP 8.1 to use Ecotone message handler attributes?

Yes, you need PHP 8.1 or higher to use Ecotone message handler attributes. The framework relies on PHP 8.1 attribute syntax to declare CommandHandler, EventHandler, QueryHandler, and ServiceActivator endpoints.

How do I access message header metadata inside an Ecotone handler?

You access message header metadata inside an Ecotone handler by using the #[Header] attribute. This allows your handler methods to read specific message headers directly from the incoming payload.

Why should I enforce a unique endpointId for each Ecotone service activator?

Enforcing a unique endpointId for each Ecotone service activator prevents routing conflicts and ensures proper output channel configuration. It provides a consistent identity for each handler across the messaging system.

Can I use Ecotone query handlers alongside command and event handlers in the same service class?

Yes, you can use Ecotone QueryHandler attributes alongside CommandHandler and EventHandler methods within the same service class. This allows you to consolidate related routing logic and endpoint configurations into a single cohesive component.