-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Issue with Gateway when using in combination with Integration flow or a channel #2731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You need to show your flow definition together with any relevant supporting code/configuration. |
This more sounds like a StackOverfow question. |
Hi @artembilan / @garyrussell / @dturanski , Good Afternoon, I am using SI 5.1.1 I have created a project to reproduce the error with gateway with minimal code. Sample Project with test cases: Test case "gatewayTestError" hangs indefinitely. I still see the below error when testing the Gateway:
|
The DSL was moved to the core project in 5.x; moving this issue there. |
I have reproduced an issue with this configuration: @MessagingGateway
public interface GatewayService {
@Gateway(requestChannel = "executorChannel")
public String echoGateway(String msg);
}
@Bean
public MessageChannel executorChannel() {
return new ExecutorChannel(Executors.newWorkStealingPool());
}
@Bean
@ServiceActivator(inputChannel = "executorChannel")
public GatewayMessageHandler gatewayMessageHandler() {
GatewayMessageHandler gatewayMessageHandler = new GatewayMessageHandler();
gatewayMessageHandler.setRequestChannelName("serviceChannel");
return gatewayMessageHandler;
}
@ServiceActivator(inputChannel = "serviceChannel")
public void handleWithError() {
throw new RuntimeException("intentional");
} Looks like the culprit is exactly that Looks like we have to rebuild an exception with really an actual |
I found a workaround like this:
Pay attention to the This way we return an original exception which is thrown to upstream to be wrapped to the proper I wonder if we should treat this as a normal logic in case of nested gateway and an |
Hi Artam, Above workaround resolved the issue. Thank you very much for the workaround. We need to see how to fix the issue in gateway. Thanks, |
Hi Artam, We have found similar issue when we use nested ScatterGather. I will create a separate issue with sample project for that. In Scatter Gather with nesting ScatterGather even the Success case is failing. Thanks, |
i wonder if the real problem is here, in the
In previous version (4.x) we didn't check for an exception and just threw a one with the current Yes, @sirimamilla , that would be great to have some sample to play with. @garyrussell , WDYT? |
Hi @artembilan , New issue #2735 has been created for the scatter Gather issue with error handling. |
Fixes spring-projects#2731 When we have a nested gateway configuration, we are loosing the context of the current request message in case of errors and downstream `MessagingException` is just re-thrown as is with already not actual `failedMessage` and its processed `errorChannel` header. * Check for exception type and for the `errorChannel` header in the current `requestMessage` before re-throwing as a new `MessageHandlingException` in the `MessagingGatewaySupport.sendAndReceive()` * Extract `.gateway()` tests into the separate `GatewayDslTests` class
Hi Gary/Artem, Thanks for providing the workarounds and fixes. Will this fix be part of 5.1.3 release? I don't see milestone assigned to this fix. Thanks for your support and fixes. Thanks, |
The milestone has been assigned. Will be released this week with many other good fixes. |
Hi @artembilan, Gateway Error Handling fix is working with the local build. Thanks, |
When Spring Integration Java DSL gateway is used in combination with Channel or Subflow, success case works perfectly fine. But when ever error occurs in the subflow or flow called by channel, below error is thrown and the caller will not get any response after that.
Error:
The text was updated successfully, but these errors were encountered: