0

我正在尝试在 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);
4

0 回答 0