-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
According to the spec, it seems that ClientRequestFilter with @Provider annotation should be used with Client without registration. This behaviour currently doesn't work on Jersey, RESTEasy fix this on server side (see RESTEASY-2084, RESTEASY-2163)
I suggest to make clear in the spec, that this can work on server side, but not on standalone client application (outside of the container).
Example of server-side client usage:
@Provider
public class TestClientRequestFilter implements ClientRequestFilter {
public void filter(ClientRequestContext clientRequestContext) {
System.out.println("Hello from ClientRequestFilter");
}
}
@Path("/a")
public class Resource {
@GET
@Path("/a")
public String a() {
return "ok";
}
@Path("/b")
@GET
public String b() {
Client client = ClientBuilder.newBuilder().build();
final WebTarget target = client.target("http://127.0.0.1:8080/jaxrs-wf/a/a");
final Response response = target.request().get();
System.out.println(response.getStatus());
System.out.println(response.readEntity(String.class));
System.out.println();
return "ok";
}
}The same situation is for ClientResponseFilter, MessageBodyReader, MessageBodyWriter, AsyncClientResponseProvider, ReaderInterceptor, WriterInterceptor, DynamicFeature