You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by sgjava <sg...@gmail.com> on 2015/04/14 16:17:42 UTC
javax.ws.rs.client.Client read timeout not working
Using TomEE 2.0.0 SNAPSHOT and Jersey/Jackson WS client as follows:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.17</version>
</dependency>
/**
* JAX-RS client.
*/
private Client client;
client = ClientBuilder.newClient().register(JacksonFeature.class).
property(ClientProperties.CONNECT_TIMEOUT, 7000).
property(ClientProperties.READ_TIMEOUT, 7000);
The read operation only times out after 30 seconds because that's what the
service is set to. Basically I have an MDB that calls a REST service, but I
need to control the timeouts on the client side since I do not control the
service. I realize this may not be a TomEE issue, but I figure others have
run across this issue before.
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: javax.ws.rs.client.Client read timeout not working
Posted by Steve Goldsmith <sg...@gmail.com>.
Yea, your previous question pointed me in the cxf direction. Are there any
negatives to using one implementation over the other since client timeouts
appear proprietary any ways.
On Tue, Apr 14, 2015 at 11:06 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> You can set the timeout to cxf http conduit.
>
> If you really want jersey try add in a
> WEB-INF/classes/META-INF/services/javax.ws.rs.client.ClientBuilder with the
> line:
>
> org.glassfish.jersey.client.JerseyClientBuilder
>
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-04-14 16:25 GMT+02:00 sgjava <sg...@gmail.com>:
>
> > org.apache.cxf.jaxrs.client.spec.ClientImpl
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416p4674420.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>
--
Steven P. Goldsmith
Re: javax.ws.rs.client.Client read timeout not working
Posted by sgjava <sg...@gmail.com>.
OK, I'm going to try the CXF way, thanks...
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416p4674426.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: javax.ws.rs.client.Client read timeout not working
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes it is proprietary but I think defaults are super close (pretty much
HttlUrlConnection ones)
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-14 17:05 GMT+02:00 sgjava <sg...@gmail.com>:
> Yea, your previous question pointed me in the cxf direction. Are there any
> negatives to using one implementation over the other since client timeouts
> appear proprietary any ways.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416p4674423.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: javax.ws.rs.client.Client read timeout not working
Posted by sgjava <sg...@gmail.com>.
Yea, your previous question pointed me in the cxf direction. Are there any
negatives to using one implementation over the other since client timeouts
appear proprietary any ways.
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416p4674423.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: javax.ws.rs.client.Client read timeout not working
Posted by Romain Manni-Bucau <rm...@gmail.com>.
You can set the timeout to cxf http conduit.
If you really want jersey try add in a
WEB-INF/classes/META-INF/services/javax.ws.rs.client.ClientBuilder with the
line:
org.glassfish.jersey.client.JerseyClientBuilder
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-14 16:25 GMT+02:00 sgjava <sg...@gmail.com>:
> org.apache.cxf.jaxrs.client.spec.ClientImpl
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416p4674420.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: javax.ws.rs.client.Client read timeout not working
Posted by sgjava <sg...@gmail.com>.
org.apache.cxf.jaxrs.client.spec.ClientImpl
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416p4674420.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: javax.ws.rs.client.Client read timeout not working
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
can you dump the value of ClientBuilder.newClient().getClass()?
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-14 16:17 GMT+02:00 sgjava <sg...@gmail.com>:
> Using TomEE 2.0.0 SNAPSHOT and Jersey/Jackson WS client as follows:
>
> <dependency>
> <groupId>org.glassfish.jersey.media</groupId>
> <artifactId>jersey-media-json-jackson</artifactId>
> <version>2.17</version>
> </dependency>
> <dependency>
> <groupId>org.glassfish.jersey.core</groupId>
> <artifactId>jersey-client</artifactId>
> <version>2.17</version>
> </dependency>
>
> /**
> * JAX-RS client.
> */
> private Client client;
>
> client = ClientBuilder.newClient().register(JacksonFeature.class).
> property(ClientProperties.CONNECT_TIMEOUT, 7000).
> property(ClientProperties.READ_TIMEOUT, 7000);
>
> The read operation only times out after 30 seconds because that's what the
> service is set to. Basically I have an MDB that calls a REST service, but I
> need to control the timeouts on the client side since I do not control the
> service. I realize this may not be a TomEE issue, but I figure others have
> run across this issue before.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/javax-ws-rs-client-Client-read-timeout-not-working-tp4674416.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>