camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: Synchronous calls from client into Camel
Date Fri, 15 Feb 2008 00:36:42 GMT
Hi Jeff,

Could you take a look at these two test cases[1][2] in the camel-cxf 
 I think that is what you want ;)



Jeff Talley wrote:
> 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...
> 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 raw message