带有PoolingClientConnectionManager的JAX-RS 2.0 Apache CXF客户端

时间:2017-05-01 04:03:59

标签: java jax-rs httpurlconnection cxf-client tomee-7

我正在尝试在TomEE-Plus 7.0.2中使用Apache CXF实现JAX-RS 2.0客户端。我可以使用下面提到的代码连接服务。但我需要实现池连接管理器和其他配置。我只获得Jersey客户端示例而不是Apache CXF示例。

有人可以帮我提供JAX-RS 2.0客户端的示例示例,其中连接池使用Apache软件包而非Jersey软件包吗?

Apache cxf客户端版本:3.1.8

泽西岛客户端示例:

http://www.theotherian.com/2013/08/jersey-client-2.0-httpclient-timeouts-max-connections.html

示例JAX-RS 2.0客户端代码:

Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://localhost:8080/rs");
target = target.path("service").queryParam("a", "avalue");

Invocation.Builder builder = target.request();
Response response = builder.get();
Book book = builder.get(Book.class);

0 个答案:

没有答案