-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClientResponseFilter not called on UnknownHostException #684
Comments
I assume you meant to say Note that ClientRequestfilter is called for such a request. Your approach is not specification compliant. According to JAX-RS 2.1 chapter 6.1 You need to attach your resources to the request object (as a request property), so they become eligible for GC once the request is cancelled. If this is not enough (e. g. too lazy), we need to extend a future version of the JAX-RS specification in a way that allows you to get an active callback on request cancellation. Is that what you strive for with this issue? In the end it would be solved by the proposal we already discussed shortly in a different thread: A custom |
Yes I meant
Yes that is what I mean. We need a callback which is called always if the request filter was called. I think we could go even further and have an interceptor per network attempt e.g. if the jax-rs supports redirects. |
Understood and agreed. We just need to find a concensus whether it is enough to wait for CDI interception (3.x), or whether we have to invent our own technology before (2.x). |
Is there any known workarounds or implementation to achieve this ? I would also like to intercept i/o exceptions in a centralized manner. |
Jersey supports a PostInvocationInterceptor that gathers the exceptions, including Keep in mind that the MP REST Client will become a part of Jakarta REST and any changes in the client API should be compatible with it. |
thanks for your reply @jansupol, |
Hi, |
Unfortunately I need to tell you that so far the vendors backing JAX-RS did not agree upon a cross-vendor API for this use case. @jamezp @jansupol @jim-krueger WDYT? |
I'm personally a +1 to waiting for the CDI integration to become defined so CDI interceptors can be used. That said, I don't see why you can't already use an interceptor as CDI, in containers at least, is supported. If we're talking about a client side that runs outside of a container, I could see another API being useful. However, I think we need to decide what will happen with clients and CDI integration. |
At the moment there is no way how to intercept exceptions like
UnknownHostException
(maybe alsoRedirectionException
) inClientResponseFilter
. Note thatClientRequestFilter
is called for a such request. If the integration uses both filters and response filter is used to free up resources this leads to leaks.The text was updated successfully, but these errors were encountered: