Bug in CXF filters ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in CXF filters ?

Aruna Kalagnanam
Hi folks,

I am using TomEE 7.0.0 M3 for my JAXRS application (using CXF 3.1.5), which
has pre-match request filters, post-match request filters and response
filters.

In one of the pre-match request filters, the code calls
requestContext.abortWith(...). As per JAXRS 2.0.x documentation on
abortWith(...) ,

This method breaks the filter chain processing and returns the provided
response back to the client. The provided response goes through the chain
of applicable response filters.

My expectation is that the request filter processing will be stopped and
even the response filter processing. Instead, I find that all of my
response filters are being executed.

Any one else experienced the same ? Is this a bug in CXF ? Any inputs here
would be most helpful.

Thanks,
Aruna.
Reply | Threaded
Open this post in threaded view
|

Re: Bug in CXF filters ?

Romain Manni-Bucau
Hi Aruna,

You quoted it: "The provided response goes through the chain of
applicable response filters."

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-03-18 2:41 GMT+01:00 Aruna Kalagnanam <[hidden email]>:

> Hi folks,
>
> I am using TomEE 7.0.0 M3 for my JAXRS application (using CXF 3.1.5), which
> has pre-match request filters, post-match request filters and response
> filters.
>
> In one of the pre-match request filters, the code calls
> requestContext.abortWith(...). As per JAXRS 2.0.x documentation on
> abortWith(...) ,
>
> This method breaks the filter chain processing and returns the provided
> response back to the client. The provided response goes through the chain
> of applicable response filters.
>
> My expectation is that the request filter processing will be stopped and
> even the response filter processing. Instead, I find that all of my
> response filters are being executed.
>
> Any one else experienced the same ? Is this a bug in CXF ? Any inputs here
> would be most helpful.
>
> Thanks,
> Aruna.
Reply | Threaded
Open this post in threaded view
|

Re: Bug in CXF filters ?

Aruna Kalagnanam
Sigh!
I need a capability to skip the response filters when there is an abort.
There doesn't seem to be a way to do that.

Any ideas on how that can be achieved?

Thanks,
Aruna
Hi Aruna,

You quoted it: "The provided response goes through the chain of
applicable response filters."

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-03-18 2:41 GMT+01:00 Aruna Kalagnanam <[hidden email]>:
> Hi folks,
>
> I am using TomEE 7.0.0 M3 for my JAXRS application (using CXF 3.1.5),
which

> has pre-match request filters, post-match request filters and response
> filters.
>
> In one of the pre-match request filters, the code calls
> requestContext.abortWith(...). As per JAXRS 2.0.x documentation on
> abortWith(...) ,
>
> This method breaks the filter chain processing and returns the provided
> response back to the client. The provided response goes through the chain
> of applicable response filters.
>
> My expectation is that the request filter processing will be stopped and
> even the response filter processing. Instead, I find that all of my
> response filters are being executed.
>
> Any one else experienced the same ? Is this a bug in CXF ? Any inputs here
> would be most helpful.
>
> Thanks,
> Aruna.
Reply | Threaded
Open this post in threaded view
|

Re: Bug in CXF filters ?

Romain Manni-Bucau
Set a property in the request context and if present skip the
processing of the response filter? Can also be a generic wrapping
responsefilter then you just wrap the filters you use.

Side note: this behavior is good cause you skip the computation of the
response but can still need to add headers for instances.

Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-03-18 8:12 GMT+01:00 Aruna Kalagnanam <[hidden email]>:

> Sigh!
> I need a capability to skip the response filters when there is an abort.
> There doesn't seem to be a way to do that.
>
> Any ideas on how that can be achieved?
>
> Thanks,
> Aruna
> Hi Aruna,
>
> You quoted it: "The provided response goes through the chain of
> applicable response filters."
>
> Romain Manni-Bucau
> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>
>
> 2016-03-18 2:41 GMT+01:00 Aruna Kalagnanam <[hidden email]>:
>> Hi folks,
>>
>> I am using TomEE 7.0.0 M3 for my JAXRS application (using CXF 3.1.5),
> which
>> has pre-match request filters, post-match request filters and response
>> filters.
>>
>> In one of the pre-match request filters, the code calls
>> requestContext.abortWith(...). As per JAXRS 2.0.x documentation on
>> abortWith(...) ,
>>
>> This method breaks the filter chain processing and returns the provided
>> response back to the client. The provided response goes through the chain
>> of applicable response filters.
>>
>> My expectation is that the request filter processing will be stopped and
>> even the response filter processing. Instead, I find that all of my
>> response filters are being executed.
>>
>> Any one else experienced the same ? Is this a bug in CXF ? Any inputs here
>> would be most helpful.
>>
>> Thanks,
>> Aruna.