camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Talley <air2...@ups.com>
Subject Re: Synchronous calls from client into Camel
Date Thu, 14 Feb 2008 21:53:27 GMT


James.Strachan wrote:
> 
>>  How can I set up Camel when running in the same JVM as a client
>> application
>>  so that I can have the client make a call to an interface that is
>>  implemented by Camel. I am basically wanting the client to make business
>>  calls on an interface and have the implementation of that interface
>> injected
>>  into the client by Spring. The implementation would be provided by Camel
>>  which could make RMI calls, web service calls, etc. on the client's
>> behalf
>>  and have the results returned back to the client on a blocking
>> synchronous
>>  call. What would the Java DSL style routing look like?
> 
> If using Camel as a kinda remoting implementation you could try the
> Spring Remoting feature...
> http://activemq.apache.org/camel/spring-remoting.html
> 
This looks like what I am looking for but I am not getting something. Let's
say I have an interface like:

public interface MathService {
   public int add(int a, int b);
   public int subtract(int a, int b);
}

And that interface is implemented by some web service on a remote server. I
could export a proxy from camel like this:

<camel:proxy id="mathServiceProxy" serviceUrl="direct:add"
serviceInterface="com.example.MathService"/>

I could then inject this proxy into my client application. If I want Camel
to route this request to a web service and return the result to the calling
client, what would the routing look like. I want to put something like:

from("direct:add").to("cxf:mathService")

Is this correct? I'm not seeing how the result of the call to the web
service makes it back to the caller.

I'm also not sure how I specify how to specify which method will be called.
Is it direct:MathService?add or just direct:add and I have to export for
each method?


-- 
View this message in context: http://www.nabble.com/Synchronous-calls-from-client-into-Camel-tp15481216s22882p15490201.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message