Spring's remote invocation infrastructure allows adding serializable attributes on a remote request in org.springframework.remoting.support.RemoteInvocation.
As the javadoc explains:
This is very useful for adding additional invocation data without having to subclass RemoteInvocation. (RemoteInvocation#addAttribute(...))
While this is supported on the remote request side, the response side does not support that.
Meaning, if there is a need to add data to the remote response, org.springframework.remoting.support.RemoteInvocationResult must be subclassed to contain the extra data.
I suggest adding attributes support to org.springframework.remoting.support.RemoteInvocationResult to match the capabilities of org.springframework.remoting.support.RemoteInvocation.
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered:
An implementation of org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(RemoteInvocation) adds an attribute requestingServer=ServerA.
App2 cluster routes the request to App2 on ServerE.
An implementation of com.plimus.platform.remoting.RemoteInfoHttpInvokerServiceExporter.invoke(RemoteInvocation, Object) retrieves the requestingServer attribute and writes it to log.
(All above is currently supported, all below requires this improvement)
An implementation of org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocation, Object) (on ServerE) adds a response attribute respondingServer=ServerE.
ServerA receives the response from ServerE, retrieves the responsingServer attribute and writes it to log.