ecotone-interceptors

Automates Before/After/Around/Presend interceptors for commands and events in Ecotone.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Ecotone interceptors provide a structured mechanism to inject cross-cutting concerns (transactions, logging, authorization, header enrichment) into handler execution via Before, After, Around, and Presend attributes with a flexible pointcut system.

Core Features & Use Cases

  • Built-in interceptor attributes: #[Before], #[After], #[Around], #[Presend] with configurable precedence and pointcuts.
  • Pointcut system supports targeting by attribute, class, method, namespace, bus, and logical operators (AND/OR/NOT).
  • Header modification capability via changeHeaders for Before, After, and Presend interceptors.
  • Auto-inference or explicit pointcuts and safe execution through MethodInvocation::proceed().
  • Practical use cases include cross-cutting concerns like transactions, auditing, validation, and correlation-id enrichment across handlers.

Quick Start

Annotate your handlers with the appropriate Ecotone interceptor attributes and run your flow to apply cross-cutting behavior.

Frequently Asked Questions about ecotone-interceptors

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

FAQPage Schema
How do I add cross-cutting interceptors like transactions or logging to command handlers?

Cross-cutting interceptors can be added to command handlers using Before, After, Around, and Presend attributes. These attributes inject logic such as transactions or logging into handler execution via a flexible pointcut system without modifying core business logic.

Can I modify message headers before or after a handler executes?

Message headers can be modified before or after handler execution using the changeHeaders capability. This header enrichment functionality is available for Before, After, and Presend interceptors to inject data like correlation IDs.

How do you control execution order when applying multiple interceptors to the same handler?

Execution order of multiple interceptors applied to the same handler is controlled using configurable precedence settings. You can assign precedence levels to Before, After, Around, and Presend attributes to ensure interceptors execute in the correct sequence.

How does an around interceptor safely proceed with the original method invocation?

An around interceptor safely proceeds with the original method invocation by calling MethodInvocation::proceed(). This allows the interceptor to execute custom logic before and after delegating to the actual handler.

Do I need to explicitly define pointcuts for every interceptor?

You do not need to explicitly define pointcuts for every interceptor because the system supports auto-inference. You can rely on automatic pointcut inference or configure explicit pointcuts when more precise targeting is necessary.