You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Gunnar Morling <gu...@googlemail.com> on 2011/06/15 22:34:46 UTC
Globally specifying JAX-WS handlers
Hi,
according to the documentation [1] one can specify interceptors on the
bus level, which will then be applied to all endpoints. Is the same
also possible for JAX-WS handlers?
Thanks, Gunnar
[1] http://cxf.apache.org/docs/bus-configuration.html
Re: AW: Globally specifying JAX-WS handlers
Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, June 16, 2011 11:38:24 PM Gunnar Morling wrote:
> > JAX-WS handlers are designed for cross-web stack portability, so you can
> > move your web service to Metro or Spring WS without coding change.
> > Since
> > portability is not a concern, by virtue of the fact that it would be
> > desired to attach the handlers via a CXF-specific bus, the developer
> > will usually (always?) want to use interceptors instead
> > (http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors),
> > as they're normally faster.
>
> Hmmm, I agree on that such a *configuration* would be CXF-specific.
> But the actual handlers would still be portable between JAX-WS
> implementations.
>
> So IMO allowing a CXF-specific global configuration of per se portable
> handlers would be beneficial for scenarios, where common handlers are
> configured for all endpoints. When migrating to another stack the
> handlers could remain unchanged, only the configuration would have to
> be adapted (which it has to be anyways, as e.g. Metro naturally
> couldn't handle CXF's Spring configuration).
>
> Performance is another story, though. Do you have any numbers how much
> faster interceptors are than handlers?
It really depends on the what you are doing in your service. If you already
have a need for the SAAJ stuff (for example: ws-security) for your service,
then the incremental performance cost is very small. The cost of producing
the DOM/SAAJ model is already required. However, if you aren't doing
something that needs the SAAJ, the performance cost really depends on a bunch
of factors:
1) Version of CXF: 2.4.x and recent 2.3.x do a good job of caching the SAAJ
factories and such which reduced a lot of contention.
2) Size of messages: since SAAJ requires the full model in memory, smaller
messages don't take much of a hit compared to large messages.
3) Content of the messages: if the content is mostly string content, I think
the impacts is slightly less than things like integers and such where new
string need to be allocated in memory and held onto.
4) likely others....
For the most part, it's generally around 10-15% slower with the handlers in
place, plus whatever cost of the handlers.
In anycase, the main issue is that with the JAX-WS handlers, the streaming of
the messages is completely disabled for both incoming and outgoing messages as
you cannot stick a handler on just one of those chains. With the
interceptors, you have a LOT more control. If you need SAAJ, you COULD just
enable it for incoming or outgoing and only take the hit on that direction.
However, in many cases, with the interceptors, you can likely solve a lot of
issues without breaking the streaming. A lot of the header manipulation and
such can be done without breaking the streaming.
Dan
>
> --Gunnar
>
> 2011/6/16 Glen Mazza <gm...@talend.com>:
> > On 06/16/2011 03:31 AM, Dirk Rudolph wrote:
> >> Can you explain, what is the reason for configuring handler only per
> >> endpoint?
> >> Wouldn't it be a nice feature configuring them globally if necessary?
> >
> > I guess it would be partly philosophical, partly due to lack of demand,
> > partly due to having such functionality added in being a potential
> > source of bugs.
> >
> > What is a JAX-WS handler, *including* how you connect it to the web
> > service or client, is defined in the JAX-WS specification. Arguably,
> > if you could connect it any other way than defined (such as with a CXF
> > bus) it wouldn't be a JAX-WS handler. :)
> >
> > JAX-WS handlers are designed for cross-web stack portability, so you can
> > move your web service to Metro or Spring WS without coding change.
> > Since
> > portability is not a concern, by virtue of the fact that it would be
> > desired to attach the handlers via a CXF-specific bus, the developer
> > will usually (always?) want to use interceptors instead
> > (http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors),
> > as they're normally faster.
> >
> > Glen
> >
> >> I also use one JAX-WS Handler in all my endpoints.
> >>
> >> Thanks, Dirk
> >>
> >> -----Ursprüngliche Nachricht-----
> >> Von: Willem Jiang [mailto:willem.jiang@gmail.com]
> >> Gesendet: Donnerstag, 16. Juni 2011 06:13
> >> An: users@cxf.apache.org
> >> Betreff: Re: Globally specifying JAX-WS handlers
> >>
> >> No, JAX-WS handlers are configured per endpoint.
> >>
> >> On 6/16/11 4:34 AM, Gunnar Morling wrote:
> >>> Hi,
> >>>
> >>> according to the documentation [1] one can specify interceptors on
> >>> the
> >>> bus level, which will then be applied to all endpoints. Is the same
> >>> also possible for JAX-WS handlers?
> >>>
> >>> Thanks, Gunnar
> >>>
> >>> [1] http://cxf.apache.org/docs/bus-configuration.html
> >
> > --
> > Glen Mazza
> > Software Engineer, Talend (http://www.talend.com)
> > blog: http://www.jroller.com/gmazza
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
Re: AW: Globally specifying JAX-WS handlers
Posted by Glen Mazza <gm...@talend.com>.
On 06/16/2011 05:38 PM, Gunnar Morling wrote:
>
> Performance is another story, though. Do you have any numbers how much
> faster interceptors are than handlers?
No; previous threads on the matter (http://tinyurl.com/3b66t7x) indicate
the need to create a DOM tree for JAX-WS Handlers as the chief cause for
the slower performance.
Glen
--
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza
Re: AW: Globally specifying JAX-WS handlers
Posted by Gunnar Morling <gu...@googlemail.com>.
> JAX-WS handlers are designed for cross-web stack portability, so you can
> move your web service to Metro or Spring WS without coding change. Since
> portability is not a concern, by virtue of the fact that it would be desired
> to attach the handlers via a CXF-specific bus, the developer will usually
> (always?) want to use interceptors instead
> (http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors), as
> they're normally faster.
Hmmm, I agree on that such a *configuration* would be CXF-specific.
But the actual handlers would still be portable between JAX-WS
implementations.
So IMO allowing a CXF-specific global configuration of per se portable
handlers would be beneficial for scenarios, where common handlers are
configured for all endpoints. When migrating to another stack the
handlers could remain unchanged, only the configuration would have to
be adapted (which it has to be anyways, as e.g. Metro naturally
couldn't handle CXF's Spring configuration).
Performance is another story, though. Do you have any numbers how much
faster interceptors are than handlers?
--Gunnar
2011/6/16 Glen Mazza <gm...@talend.com>:
> On 06/16/2011 03:31 AM, Dirk Rudolph wrote:
>>
>> Can you explain, what is the reason for configuring handler only per
>> endpoint?
>> Wouldn't it be a nice feature configuring them globally if necessary?
>>
>
> I guess it would be partly philosophical, partly due to lack of demand,
> partly due to having such functionality added in being a potential source of
> bugs.
>
> What is a JAX-WS handler, *including* how you connect it to the web service
> or client, is defined in the JAX-WS specification. Arguably, if you could
> connect it any other way than defined (such as with a CXF bus) it wouldn't
> be a JAX-WS handler. :)
>
> JAX-WS handlers are designed for cross-web stack portability, so you can
> move your web service to Metro or Spring WS without coding change. Since
> portability is not a concern, by virtue of the fact that it would be desired
> to attach the handlers via a CXF-specific bus, the developer will usually
> (always?) want to use interceptors instead
> (http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors), as
> they're normally faster.
>
> Glen
>
>
>
>
>> I also use one JAX-WS Handler in all my endpoints.
>>
>> Thanks, Dirk
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Willem Jiang [mailto:willem.jiang@gmail.com]
>> Gesendet: Donnerstag, 16. Juni 2011 06:13
>> An: users@cxf.apache.org
>> Betreff: Re: Globally specifying JAX-WS handlers
>>
>> No, JAX-WS handlers are configured per endpoint.
>>
>> On 6/16/11 4:34 AM, Gunnar Morling wrote:
>>>
>>> Hi,
>>>
>>> according to the documentation [1] one can specify interceptors on the
>>> bus level, which will then be applied to all endpoints. Is the same
>>> also possible for JAX-WS handlers?
>>>
>>> Thanks, Gunnar
>>>
>>> [1] http://cxf.apache.org/docs/bus-configuration.html
>>>
>>
>
>
> --
> Glen Mazza
> Software Engineer, Talend (http://www.talend.com)
> blog: http://www.jroller.com/gmazza
>
>
>
Re: AW: Globally specifying JAX-WS handlers
Posted by Glen Mazza <gm...@talend.com>.
On 06/16/2011 03:31 AM, Dirk Rudolph wrote:
> Can you explain, what is the reason for configuring handler only per
> endpoint?
> Wouldn't it be a nice feature configuring them globally if necessary?
>
I guess it would be partly philosophical, partly due to lack of demand,
partly due to having such functionality added in being a potential
source of bugs.
What is a JAX-WS handler, *including* how you connect it to the web
service or client, is defined in the JAX-WS specification. Arguably, if
you could connect it any other way than defined (such as with a CXF bus)
it wouldn't be a JAX-WS handler. :)
JAX-WS handlers are designed for cross-web stack portability, so you can
move your web service to Metro or Spring WS without coding change.
Since portability is not a concern, by virtue of the fact that it would
be desired to attach the handlers via a CXF-specific bus, the developer
will usually (always?) want to use interceptors instead
(http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors),
as they're normally faster.
Glen
> I also use one JAX-WS Handler in all my endpoints.
>
> Thanks, Dirk
>
> -----Ursprüngliche Nachricht-----
> Von: Willem Jiang [mailto:willem.jiang@gmail.com]
> Gesendet: Donnerstag, 16. Juni 2011 06:13
> An: users@cxf.apache.org
> Betreff: Re: Globally specifying JAX-WS handlers
>
> No, JAX-WS handlers are configured per endpoint.
>
> On 6/16/11 4:34 AM, Gunnar Morling wrote:
>> Hi,
>>
>> according to the documentation [1] one can specify interceptors on the
>> bus level, which will then be applied to all endpoints. Is the same
>> also possible for JAX-WS handlers?
>>
>> Thanks, Gunnar
>>
>> [1] http://cxf.apache.org/docs/bus-configuration.html
>>
>
--
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza
AW: Globally specifying JAX-WS handlers
Posted by Dirk Rudolph <Di...@t-systems-mms.com>.
Can you explain, what is the reason for configuring handler only per
endpoint?
Wouldn't it be a nice feature configuring them globally if necessary?
I also use one JAX-WS Handler in all my endpoints.
Thanks, Dirk
-----Ursprüngliche Nachricht-----
Von: Willem Jiang [mailto:willem.jiang@gmail.com]
Gesendet: Donnerstag, 16. Juni 2011 06:13
An: users@cxf.apache.org
Betreff: Re: Globally specifying JAX-WS handlers
No, JAX-WS handlers are configured per endpoint.
On 6/16/11 4:34 AM, Gunnar Morling wrote:
> Hi,
>
> according to the documentation [1] one can specify interceptors on the
> bus level, which will then be applied to all endpoints. Is the same
> also possible for JAX-WS handlers?
>
> Thanks, Gunnar
>
> [1] http://cxf.apache.org/docs/bus-configuration.html
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Re: Globally specifying JAX-WS handlers
Posted by Willem Jiang <wi...@gmail.com>.
No, JAX-WS handlers are configured per endpoint.
On 6/16/11 4:34 AM, Gunnar Morling wrote:
> Hi,
>
> according to the documentation [1] one can specify interceptors on the
> bus level, which will then be applied to all endpoints. Is the same
> also possible for JAX-WS handlers?
>
> Thanks, Gunnar
>
> [1] http://cxf.apache.org/docs/bus-configuration.html
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang