Setting Timeout For JAX-RS / TomEE CXF Client 📎
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.