You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2013/11/01 17:55:02 UTC

Re: Local transport queries

Hi Mandy
On 10/10/13 22:30, Mandy Warren wrote:
>
> Thanks so much for the fast reply! A few comments below..
>
> Sent from a mobile device
>
> On 10 Oct 2013, at 21:39, Daniel Kulp <dk...@apache.org> wrote:
>
>>
>> On Oct 10, 2013, at 2:35 PM, Mandy Warren <ma...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> We have so far used local transports for our rest service testing but we're now evaluating it for use as an efficient way to talk between services in different war files.
>>>
>>> I had a few questions..
>>>
>>> 1. How does CXF locate/lookup the called service? I assume that each war has it's own bus so don't understand how CXF locates services running on other buses unless it's using something like JNDI..
>>
>> It doesn't.   The Local transport is only for services that can be found on the same bus.    THAT said, if the two wars end up using the "default" bus, it's possible that they could find each other.
>>
>
> So how do I get the 2 wars to share the same default bus? Is it by moving the cxf jar out of the war classpath and onto either an ear classpath or the app server classpath?
>
I guess the way to do it is indeed to have a shared loader for the CXF 
libraries.
> Would there be any downside to a large number of web services all sharing this single bus?
>

I'm not aware of any immediate issues to do with a single bus sharing a 
large number of services per se, but what may become a problem is that 
configuring a default bus will affect all services and the more you have 
the less likely you'd like it to happen, though it may depend on the 
requirements.
>>
>>> 2. Is the call between wars using local transport made on the same thread?
>>
>> See above.   But if they are on the same bus, it is configurable as to weather the same thread is used or if it will pop onto a thread pool.
>>
> Please can you explain where the config can be made?
>
It's likely HTTP container specific, CXF supports Jetty:
http://cxf.apache.org/docs/jetty-configuration.html

Tomcat will likely have its own way to do it

Cheers, Sergey

> Many thanks
>>
>>> 3. The documentation mentions "You can also configure the local transport to avoid serialization by using the Object binding or the colocation feature if desired". Please can you explain the Object binding and how it differs from coloc?
>>
>> Object Binding + Local transport is CLOSE to using Coloc.  However, coloc  bypasses much of the interceptor chains whereas Local+Object keeps the interceptor chains in place.   Thus, if you have particular interceptors that need to run, they may not work as well with the coloc stuff.
>>
>>
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>>


Re: Local transport queries

Posted by Mandy Warren <ma...@gmail.com>.
Many thanks for the reply - this makes it clearer

On 1 Nov 2013, at 16:55, Sergey Beryozkin wrote:

> Hi Mandy
> On 10/10/13 22:30, Mandy Warren wrote:
>> 
>> Thanks so much for the fast reply! A few comments below..
>> 
>> Sent from a mobile device
>> 
>> On 10 Oct 2013, at 21:39, Daniel Kulp <dk...@apache.org> wrote:
>> 
>>> 
>>> On Oct 10, 2013, at 2:35 PM, Mandy Warren <ma...@gmail.com> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> We have so far used local transports for our rest service testing but we're now evaluating it for use as an efficient way to talk between services in different war files.
>>>> 
>>>> I had a few questions..
>>>> 
>>>> 1. How does CXF locate/lookup the called service? I assume that each war has it's own bus so don't understand how CXF locates services running on other buses unless it's using something like JNDI..
>>> 
>>> It doesn't.   The Local transport is only for services that can be found on the same bus.    THAT said, if the two wars end up using the "default" bus, it's possible that they could find each other.
>>> 
>> 
>> So how do I get the 2 wars to share the same default bus? Is it by moving the cxf jar out of the war classpath and onto either an ear classpath or the app server classpath?
>> 
> I guess the way to do it is indeed to have a shared loader for the CXF libraries.
>> Would there be any downside to a large number of web services all sharing this single bus?
>> 
> 
> I'm not aware of any immediate issues to do with a single bus sharing a large number of services per se, but what may become a problem is that configuring a default bus will affect all services and the more you have the less likely you'd like it to happen, though it may depend on the requirements.
>>> 
>>>> 2. Is the call between wars using local transport made on the same thread?
>>> 
>>> See above.   But if they are on the same bus, it is configurable as to weather the same thread is used or if it will pop onto a thread pool.
>>> 
>> Please can you explain where the config can be made?
>> 
> It's likely HTTP container specific, CXF supports Jetty:
> http://cxf.apache.org/docs/jetty-configuration.html
> 
> Tomcat will likely have its own way to do it
> 
> Cheers, Sergey
> 
>> Many thanks
>>> 
>>>> 3. The documentation mentions "You can also configure the local transport to avoid serialization by using the Object binding or the colocation feature if desired". Please can you explain the Object binding and how it differs from coloc?
>>> 
>>> Object Binding + Local transport is CLOSE to using Coloc.  However, coloc  bypasses much of the interceptor chains whereas Local+Object keeps the interceptor chains in place.   Thus, if you have particular interceptors that need to run, they may not work as well with the coloc stuff.
>>> 
>>> 
>>> 
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org - http://dankulp.com/blog
>>> Talend Community Coder - http://coders.talend.com
>>> 
>