In my spring integration application I have Async gateway method that does errorChannel specified.
On Error - I want to handle the error (which I am able to do successfully) by registering an Integration Flow to the errorChannel.
Once the error is Handled and processed, conditionally I might want to send to a different channel for further processing and at the end reply back to the gateway. What is the best way to achieve this?
Example ->
@MessagingGateway(errorChannel = "errorChannel")
public interface OrchestrationServicesGateway {
@Gateway(requestChannel = "payment.input", replyChannel =
"payment.output")
Future<JobData> processPayment(PaymentRequest request);
}
Integration Flow has step A->B->C->D->end
Now if step B throws an error, I want to handle in a generic function and based on some rules, we might want to continue to C or Jump to D/end.
How do I achieve this ?