It's about using one API's reply channel in another API.
I have API 1 which does some operations on the entity and unlocks the entity. & API 2 which unlocks an entity. I have make them work so that they can be called independently.
API2 unlocks the entity using http inbound and outbound gateway.
I am calling API2's http inbound gateway request-channel in API1 to call API2(to implement unlock part of API1) and if API2 returns success, I want to send custom success response from API1 so for that purpose, I am using API2's reply channel as a input channel in API1 which is messing things up.
so If I call API2 independently, at the end it also calls API1 chain flow where API2's reply channel is used as input channel(which is obvious) and throwing exception Expression evaluation failed as I am using some variable from the chain above.
Is there any way to handle it in a better way? Please help!