Reputation: 747
I have the following case: in my app I need to interrupt the flow execution. There is a chain with a set of methods calls. How can I cancel the this methods set execution? Throwing exception is not an option in this case (It's a legacy project and exceptions are handled in some Aspect, it's better to avoid touching this code so far). Insert smth. like a filter after each method call?
Upvotes: 1
Views: 240
Reputation: 121550
You can have something like global ChannelInterceptor
with a pattern to match for desired channels to check the state for possible interruption behavior.
See documentation for more info: https://docs.spring.io/spring-integration/docs/5.1.6.RELEASE/reference/html/#channel-interceptors
This is some kind of Aspect as well, but in terms of Spring Integration and EIP.
Upvotes: 1