You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by tdlage <td...@hotmail.com> on 2013/03/27 00:00:46 UTC

RMI response

I want to use my route output body to be the response of my rmi service. But
it doesn´t work.

My interface:

public interface HelloService extends Remote {
	public String sayHello(String name) throws RemoteException;
}

My route:

<route>
    <from
uri="rmi://localhost:1099/helloService?remoteInterfaces=com.test.HelloService"/>
    <setBody><simple>Hello ${body.args[0]}</simple></setBody>
</route>


The client:

Registry registry = LocateRegistry.getRegistry("localhost",1099);
HelloService stub = (HelloService) registry.lookup("helloService");
System.out.println("response: " + stub.sayHello("john"));

And response, expected was "Hello john"
response: null


If i change 
<setBody><simple>Hello ${body.args[0]}</simple></setBody>

to 
<to uri="bean:helloServiceImpl"/> 

it works. 

But i don´t want to implement the service as a bean. My route output body
should be the return object of my rmi call.



--
View this message in context: http://camel.465427.n5.nabble.com/RMI-response-tp5729876.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: RMI response

Posted by tdlage <td...@hotmail.com>.
i figured it out...

<route>
    <from
uri="rmi://localhost:1099/helloService?remoteInterfaces=com.test.HelloService"/>
    *<setExchangePattern pattern="InOut"/>*
    <setBody><simple>Hello ${body.args[0]}</simple></setBody>
</route>


now it works ...



--
View this message in context: http://camel.465427.n5.nabble.com/RMI-response-tp5729876p5729878.html
Sent from the Camel - Users mailing list archive at Nabble.com.