[ https://issues.apache.org/jira/browse/CXF-4747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13635174#comment-13635174 ]
Mike Noordermeer commented on CXF-4747: --------------------------------------- {quote} I see that when WebClient is created from the code and invoked in context of the server invocation it will use the thread default bus (by default), so I'm assuming that this will be the existing bus. {quote} AFAIK the thread bus is different from the Spring context bus, and is just a default empty bus that's created. A jaxrs:client is initialized with the right bus (since that one is created by JAXRSClientFactoryBeanDefinitionParser, and uses its inner JAXRSSpringClientFactoryBean). I think something like jaxrs:webclient or getting a webclient from jaxrs:client would solve my 'issue'. I didn't want to use a jaxrs:client because it needs a service interface, and I just needed a plain WebClient. The code from the issue description seemed to be the only way to get the existing Spring CXF bus into the WebClient (but I might be wrong there). > Support easier configuration of Spring bus with WebClient > --------------------------------------------------------- > > Key: CXF-4747 > URL: https://issues.apache.org/jira/browse/CXF-4747 > Project: CXF > Issue Type: Improvement > Components: JAX-RS > Affects Versions: 2.7.1 > Reporter: Mike Noordermeer > Priority: Minor > > 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|http://mail-archives.apache.org/mod_mbox/cxf-users/201001.mbox/%3cd9d39d1e52c5514c94de9b5e928c72db032bc...@mail02.bedford.progress.com%3E], > but without an answer. > I have found a workaround, but I don't find it too pretty: > {code:xml} > <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" /> > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira