Setting Timeout For JAX-RS / TomEE CXF Client

The name of the "read" and "connection" timeout properties is not standardized in Java EE 7. For TomEE / CXF clients you will have to use the "CXF-proprietary" names:


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

Client client = ClientBuilder.newClient();
client.property("http.connection.timeout", 500L);
client.property("http.receive.timeout", 500L);

The name differs in Jersey (used in GlassFish / Payara), but the semantics are the same.

See you at Java EE Microservices. Is Munich's airport too far? Learn from home: javaeemicro.services.


NEW online workshop: WebStandards Igniter (online)

Airport MUC workshops: Java EE 8, Java 9: Bootstrap, Effective, Architectures, Single Page Apps, Progressive Web Apps, HTML 5, ES 6, CSS 3 and Microservices

Podcast: airhacks.fm and newsletter: airhacks.news

A book about rethinking Java EE Patterns

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
realworldpatterns.com
Online Workshops
...the last 150 posts
...the last 10 comments
License