You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nivetha Shri <ni...@gmail.com> on 2009/02/17 11:33:47 UTC

RMI Component in camel

Hi All
Can someone tell me how to use RMI component in Camel?

It is given tat we can hit the rmi service as follows..
from(inputEndPoint).to("rmi://localhost:1099/foo")

I have bound the service as follows

MyImpl obj = new MyImpl (); Naming.rebind("//localhost:1099/foo", obj);

Usually, in a normal client we will invoke the rmi service as follows
Hello obj = (Hello)Naming.lookup("//localhost:1099/foo");
message = obj.myMethod();

i.e., we would get the object from the bindings and then invoke the methods
that we do need.

How can we achieve the same from camel? Any pointers to articles on this?

Any help would be of great use.

Thanks and Regards
Nivi

Re: RMI Component in camel

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can check out the unit test source code
http://svn.apache.org/viewvc/camel/trunk/components/camel-rmi/

I guess the rmi wiki page could use an update.
http://camel.apache.org/rmi.html

If you get it working and feel like it, we would love
feedback/countributions on this RMI component
http://camel.apache.org/contributing.html

Post back the working solution/feedback and I can help update the wiki page.


On Tue, Feb 17, 2009 at 11:33 AM, Nivetha Shri <ni...@gmail.com> wrote:
> Hi All
> Can someone tell me how to use RMI component in Camel?
>
> It is given tat we can hit the rmi service as follows..
> from(inputEndPoint).to("rmi://localhost:1099/foo")
>
> I have bound the service as follows
>
> MyImpl obj = new MyImpl (); Naming.rebind("//localhost:1099/foo", obj);
>
> Usually, in a normal client we will invoke the rmi service as follows
> Hello obj = (Hello)Naming.lookup("//localhost:1099/foo");
> message = obj.myMethod();
>
> i.e., we would get the object from the bindings and then invoke the methods
> that we do need.
>
> How can we achieve the same from camel? Any pointers to articles on this?
>
> Any help would be of great use.
>
> Thanks and Regards
> Nivi
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: RMI Component in camel

Posted by Gert Vanthienen <ge...@gmail.com>.
Nivi,

The easiest way to use this type of route, is by using a ProxyHelper
to create a proxy for you target RMI service that uses the
'inputEndpoint' to send exchanges to the target endpoint over RMI.
Have a look at the source code for the unit tests in
http://svn.eu.apache.org/viewvc/camel/trunk/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiRouteTest.java.

The RMI endpoint takes care of the naming call you mentioned as well
as some other RMI internals.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/2/17 Nivetha Shri <ni...@gmail.com>:
> Hi All
> Can someone tell me how to use RMI component in Camel?
>
> It is given tat we can hit the rmi service as follows..
> from(inputEndPoint).to("rmi://localhost:1099/foo")
>
> I have bound the service as follows
>
> MyImpl obj = new MyImpl (); Naming.rebind("//localhost:1099/foo", obj);
>
> Usually, in a normal client we will invoke the rmi service as follows
> Hello obj = (Hello)Naming.lookup("//localhost:1099/foo");
> message = obj.myMethod();
>
> i.e., we would get the object from the bindings and then invoke the methods
> that we do need.
>
> How can we achieve the same from camel? Any pointers to articles on this?
>
> Any help would be of great use.
>
> Thanks and Regards
> Nivi
>