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
RmiOutboundGateway does not correctly check if the original outgoing message had an "errorChannel" header [INT-3031] #7005
Comments
Gary Russell commented The The |
Jürgen Failenschmid commented I discovered this issue for an inbound web-service gateway. Regular replies and downstream exceptions were arriving correctly at the WS gateway and translated into SOAP responses. As soon as I introduced the I verified that the outbound messages arriving at the |
Gary Russell commented That's not what I would expect; the ErrorMessage should not end up in the default errorChannel. The exception propagated from the remote server should be propagated to the inbound gateway, the same as any other. Can you share your full config on the client side, and perhaps a DEBUG log that exhibits this behavior? |
Gary Russell commented I just ran a test and all works as I would have expected. I posted a Gist here... https://gist.github.com/garyrussell/5639657 that illustrates the behavior when the upstream inbound gateway has an error channel, and when it does not. |
Jürgen Failenschmid commented Client beans configuration and debug-level log for a request that resulted in an exception propagated from the RMI server. |
Jürgen Failenschmid commented I removed too much from the client beans configuration. This bean is the inbound web-service gateway:
|
Gary Russell commented Aha! The missing piece of the puzzle is you have a queue channel in the flow; my test case worked because I was using a direct channel. Because RMI exchanges messages with the remote system, when the remote system throws an exception, the exception that the outbound gateway receives contains a When the exception is thrown back to the poller, it's Thanks for finding this and sorry it took so long to figure out what happened; I failed to notice the I need to discuss the fix for this with Mark Fisher. For all other outbound gateways, the So we have a few choices - make the
|
Gary Russell commented FWIW, the fix for the third option is as simple as...
|
Jürgen Failenschmid commented No problem, Gary. You have been very helpful. Thank you! |
Gary Russell commented cherry-pick to 2.2.x |
Mark Fisher commented Merged the PR and cherry-picked to 2.2.x branch. |
Jürgen Failenschmid opened INT-3031 and commented
If an exception is propagated from
RmiInboundGateway
toRmiOutboundGateway
, the exception is always sent to the special channel "errorChannel".RmiOutboundGateway
does not correctly check if the original outgoing message had an "errorChannel" header.The exception propagates just fine, but
RmiOutboundGateway
's exception handling always ignores the header "errorChannel" of the outgoing message. Instead, all exceptions are routed to the special "errorChannel". I think the intention of the code is (or should be) to first check the "errorChannel" header, and only if the header is missing, route to the default error channel.For example, it should be sufficient to configure this pair of RMI gateways in the two JVMs and a server-side exception should be routed to the channel specified in the outgoing message's "errorChannel" header.
Client:
Server:
Affects: 2.2.3
Reference URL: http://forum.springsource.org/showthread.php?137806-RMI-gateway-error-channel-issues
Attachments:
The text was updated successfully, but these errors were encountered: