On Tue, Feb 11, 2014 at 9:43 AM, Mandy Warren <[email protected]> wrote:
> Thanks very much Claus & Dan for replying - Dan I will take a look at what 
> you suggest regarding local transport and mail you on the cxf user group if I 
> have further questions (which is very likely :-))
>
> Claus - I'd really appreciate it if you could send me a sample camel route 
> which shows how to route via direct-vm from one CXF rest service in one war 
> to another in another war as I just don't understand what the format of the 
> uris in the from/to should look like.
>

The direct-vm has a little example
http://camel.apache.org/direct-vm

But that is using Camel routes. If you use pure CXF-RS (without Camel)
then you can use the Camel ProducerTemplate API to send a message to a
camel endpoint from java code.
http://camel.apache.org/producertemplate.html


> Many thanks
>
> Mandy
>
> On 10 Feb 2014, at 15:08, Daniel Kulp wrote:
>
>>
>> You should be able to use the Local transport, but as you said, it's not 
>> exactly easy.  It would likely also require you to have the CXF jars in the 
>> shared/lib area of your app server so that the actual java classes are 
>> shared and can be cast to one another.   You'd probably need to create a 
>> very small jar (also in shared/lib) with a Spring factory thing that would 
>> return a LocalTransportFactory singleton (instead of a new instance per 
>> bus).  Each of your wars would then grab their LocalTranportFactory via that 
>> factory.    May also be able to do it via a BusLIstener or similar that 
>> would register a singleton factory for each bus that is created.
>>
>> Dan
>>
>>
>>
>>
>>
>> On Feb 9, 2014, at 5:21 PM, Mandy Warren <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I've just started looking at Camel and I was wondering whether there was a
>>> way to call from a CXF rest service deployed in war A to a CXF rest service
>>> deployed in war B without the overhead of an HTTP call if both wars are
>>> deployed in the same JVM?
>>>
>>> Some background to my requirement..
>>> - we have a large number of cxf services deployed in weblogic and a single
>>> service may call 2 or 3 other services to complete its work. We'd ideally
>>> like the calls to be made on a single thread when the calls are within the
>>> same JVM as it makes debugging much easier.
>>>
>>> Local transport in CXF looks ideal except it doesn't work across wars (at
>>> least I haven't managed to make it work).
>>>
>>> direct-vm looks interesting but I don't want the 2 services to be dependent
>>> on each others service interface classes - instead I'd just like to pass a
>>> JSON request between the 2 services and then have something execute the
>>> appropriate rest service (and it's interceptors ideally).
>>>
>>> Is there any way to achieve this?
>>>
>>> Many thanks
>>> Mandy
>>
>> --
>> Daniel Kulp
>> [email protected] - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to