Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.7.1
-
None
-
Unknown
Description
The current WebClient.create() methods only support either using a fresh bus, or creating a new bus from a Spring config file. It should be possible to reuse an existing Spring bus, so you can for instance enter your <http:conduit> elements in your usual Spring config.
The same issue was asked before on the mailing list, but without an answer.
I have found a workaround, but I don't find it too pretty:
<http:conduit name="*.http-conduit"> <http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000" /> <http:tlsClientParameters> <sec:keyManagers keyPassword="pass"> <sec:keyStore resource="mykeystore.jks" password="pass" type="JKS" /> </sec:keyManagers> </http:tlsClientParameters> </http:conduit> <bean id="myWebClientFactory" class="org.apache.cxf.jaxrs.spring.JAXRSClientFactoryBeanDefinitionParser.JAXRSSpringClientFactoryBean"> <property name="address" value="${myurl}" /> <property name="providers"> <list> <bean class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider" /> </list> </property> </bean> <bean id="myWebClient" factory-bean="myWebClientFactory" factory-method="createWebClient" />