Now, when defining an ExchangeInterceptors in a SwitchYard composite it applies to every wire defined in the composite. This is not ideal as usually you add logic to opt if the processor applies to the specific request. Also, you may want to have same type of request applying different ExchangeProcessor, or have mock implementations injected via @Alternatives in JUnit tests.
ExchangeInterceptors, when defined, could be annotated with the from/to indicate the wire it applies, and should only be injected at deployment time to the appropriate wire. If now, there is a common Processor that executes all defined ExchangeInterceptors, this could be changed to only register the ExchangeInterceptors to the appropriate wire.
It will improve on:
- Reusability and applications design