You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by gnanapandithan <m....@gmail.com> on 2017/05/01 15:09:05 UTC

JAX-RS 2.0 Apache CXF client with PoolingClientConnectionManager

I am trying to implement JAX-RS 2.0 client using Apache CXF in Tomeeplus
7.0.2. I am able to connect service using below mentioned code. But I need
to implement Pooling connection manager and other configuration. I am
getting only Jersey client example not Apache CXF example.

Can anybody help me to provide sample example for JAX-RS 2.0 client with
Connection pooling with Apache Packages not with Jersey packages?

**

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

**

Sample JAX-RS 2.0 client code
**:

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);



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-RS-2-0-Apache-CXF-client-with-PoolingClientConnectionManager-tp4681637.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JAX-RS 2.0 Apache CXF client with PoolingClientConnectionManager

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You should probably ask CXF list but for now you need to override the
httpconduit with the hc one.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-05-01 19:48 GMT+02:00 gnanapandithan <m....@gmail.com>:

> sorry, I am not able get sample code from given links.  could u please give
> me sample code from tutorial.
>
> I am expecting sample code like below mentioned tutorial. but below one
> uses
> Jersey I want Apache packages.
>
> http://www.theotherian.com/2013/08/jersey-client-2.0-
> httpclient-timeouts-max-connections.html
>
> Need your help.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JAX-RS-2-0-Apache-CXF-client-with-
> PoolingClientConnectionManager-tp4681637p4681641.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JAX-RS 2.0 Apache CXF client with PoolingClientConnectionManager

Posted by gnanapandithan <m....@gmail.com>.
sorry, I am not able get sample code from given links.  could u please give
me sample code from tutorial.

I am expecting sample code like below mentioned tutorial. but below one uses
Jersey I want Apache packages.

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

Need your help. 



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-RS-2-0-Apache-CXF-client-with-PoolingClientConnectionManager-tp4681637p4681641.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JAX-RS 2.0 Apache CXF client with PoolingClientConnectionManager

Posted by Romain Manni-Bucau <rm...@gmail.com>.
CXF documents it at http://cxf.apache.org/docs/jax-rs-client-api.html

you have an example at
https://github.com/apache/cxf/blob/master/rt/transports/http-hc/src/test/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitTest.java#L65

Not sure where the complete doc is but you can find properties used at
https://github.com/apache/cxf/blob/a36af6323505211479c875fb9923cc6dcbc6ac95/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java#L172


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-05-01 17:53 GMT+02:00 gnanapandithan <m....@gmail.com>:

> Could you please give me any sample code or link ? it will help me to
> understand. thanks
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JAX-RS-2-0-Apache-CXF-client-with-
> PoolingClientConnectionManager-tp4681637p4681639.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: JAX-RS 2.0 Apache CXF client with PoolingClientConnectionManager

Posted by gnanapandithan <m....@gmail.com>.
Could you please give me any sample code or link ? it will help me to
understand. thanks



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-RS-2-0-Apache-CXF-client-with-PoolingClientConnectionManager-tp4681637p4681639.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: JAX-RS 2.0 Apache CXF client with PoolingClientConnectionManager

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Since cxf uses HtypUrlConnection by default you can set it up on the jvm.
If you want a more fine grained config you can have a look to
cxf-rt-transports-http-hc which enables to use httpcomponents under the
hood.


Le 1 mai 2017 17:23, "gnanapandithan" <m....@gmail.com> a écrit :

> I am trying to implement JAX-RS 2.0 client using Apache CXF in Tomeeplus
> 7.0.2. I am able to connect service using below mentioned code. But I need
> to implement Pooling connection manager and other configuration. I am
> getting only Jersey client example not Apache CXF example.
>
> Can anybody help me to provide sample example for JAX-RS 2.0 client with
> Connection pooling with Apache Packages not with Jersey packages?
>
> **
>
> Jersey client example
> **
> http://www.theotherian.com/2013/08/jersey-client-2.0-
> httpclient-timeouts-max-connections.html
>
> **
>
> Sample JAX-RS 2.0 client code
> **:
>
> 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);
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JAX-RS-2-0-Apache-CXF-client-with-
> PoolingClientConnectionManager-tp4681637.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>