I have a JAX-RS client in CXF created via JAXRSClientFactoryBean.create. How can I set the connection/receive timeouts?
I assume I need to get hold of the conduit but can't work out how to. This project is not using Spring.
I have a JAX-RS client in CXF created via JAXRSClientFactoryBean.create. How can I set the connection/receive timeouts?
I assume I need to get hold of the conduit but can't work out how to. This project is not using Spring.
HTTPClientPolicy clientConfig = WebClient.getConfig(service).getHttpConduit().getClient();
clientConfig.setReceiveTimeout(10000);
Here's the code I use:
service = JAXRSClientFactory.create(url, serviceClass, providers);
HTTPConduit conduit = WebClient.getConfig(service).getHttpConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setReceiveTimeout(300000); //5 minutes
conduit.setClient(policy);
HTTPClientPolicy clientConfig = WebClient.getConfig(service).getHttpConduit().getClient();
clientConfig.setReceiveTimeout(10000);
© 2022 - 2024 — McMap. All rights reserved.