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.