Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4747

Support easier configuration of Spring bus with WebClient

    XMLWordPrintableJSON

Details

    • 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" />
      

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            miken Mike Noordermeer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: