0 Replies Latest reply on Sep 9, 2016 2:06 AM by Nitesh jain

    How to do connection pooling on CXF endpoint

    Nitesh jain Newbie

         I'm using camel 2.15.3 and cxf 3.0.6


      I have an cxf endpoint as below in my camel context .. (TEST_ENDPOINT is an actual endpoint)
      <to uri="cxf://{{TEST_ENDPOINT}}?dataFormat=payload&amp;loggingFeatureEnabled=true" />


      I wanted to limit the number of HTTP connections to TEST_ENDPOINT, Tried below but it doesn't help..


      <bean id="http" class="org.apache.camel.component.http.HttpComponent">
                      <property name="camelContext" ref="sendSMSContext_rest" />
                      <property name="httpConnectionManager" ref="myHttpConnectionManager" />


              <bean id="myHttpConnectionManager"


                      <property name="params" ref="myHttpConnectionManagerParams" />


              <bean id="myHttpConnectionManagerParams"
                      <property name="maxTotalConnections" value="5" />


      according to this post http://cxf.547215.n5.nabble.com/HTTP-Connection-Pooling-td561783.html,

      CXF relies on the out-of-the-box java.net URL and HttpURLConnection, so i also tried setting up the following in my camel context xml


      <bean id="systemProps"




                    <property name="targetObject" value="#{@systemProperties}" />


                    <property name="targetMethod" value="putAll" />


                    <property name="arguments">




                                 <prop key="http.maxConnections">10</prop>


                                 <prop key="Connection">close</prop>







      But still i can see more than 200 Established connections, seems like there is no effect ...


      When i do a load test, i can see 200+ ESTABLISHED connection, though maxTotalConnections is 5 !!
      any help is appreciated. 





      Remove Ads

      CXF relies on the out-of-the-box java.net URL and HttpURLConnection