I've a repository from which I need to get some information(both uses Spring FW).
Now I want to do a SpringRemoting and execute a method in that and I am looking to use SpringIntegration for that with the HttpInvokerOutboundGateway.
But I've not been able to figure out how do i execute the remote object.
In the future please provide more information. Based on this post it seem to me you are looking for a general explanation and example which is available in Spring Reference Manual (see above)
As far as HttpInvoker support in Spring Integration, it is being deprecated in favor of REST support provided by HTTP module which uses Spring's RestTemplate. HttpInvoker will be completely removed in the next version. What kind of repository you are talking about?
App1 interacts with App2 using HttpInvokerProxyFactoryBean, so a remore service in App2 is currently called from App1.
Now I'm trying to introduce Content Based Routing in App1 using SpringIntegration, so the request goes to a specific Instance of App2. The actual call to App2 will have to be through a remote service, so I was hoping to use the HttpInvoker.
I've attached a jpg(within the zip, not able to upload the jpg) explaining what I'm trying to do.
public class App2Adapter{
public IResponse execute(){
IRemoteObject controller = (IRemoteObject) factory.create("AppProxyFactoryBean", "");
response = (IResponse) controller.execute(request); // this invokes the execute in RemoteObject
}
}
Now I'm introducing SpringIntegration at App1, to chose the URL based on the request. And I want to execute that request remotely in App2.
How do I do that?
All I am saying is that based on your explanation APP2 is just a web app which exposes a Controller which you were planning to invoke via Http Invoker.
A better way is to invoke it via Http Outbound Gateway instead of deprecated Http Invoker. Check out our samples, there is an example called multipart-http which has both HTTP inbound and outbound adapter.
And then you can have transformers,routers etc., on either side.