Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12451

Memory leak: camel-cxf componet don't release UoW in case of using "robust" property

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.20.2, 2.20.3
    • Fix Version/s: 2.20.4, 2.21.1, 2.22.0
    • Component/s: camel-cxf
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      In case of using "org.apache.cxf.oneway.robust" property camel-cxf component doesn't release UoW that leads to huge memory leak. I think it's relied with  the feature of output chain of cxf framwork which doesn't invoke additional interceptors in case of oneway operation.

      in other words, this code is not called:

      https://github.com/apache/camel/blob/master/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java

       

      
      
      private class UnitOfWorkCloserInterceptor extends AbstractPhaseInterceptor<Message> {
         public UnitOfWorkCloserInterceptor() {
            super(Phase.POST_LOGICAL_ENDING);
      }
      @Override
      public void handleMessage(Message message) throws Fault {
            Exchange cxfExchange = null;
            if ((cxfExchange = message.getExchange()) != null) {
               org.apache.camel.Exchange exchange =             cxfExchange.get(org.apache.camel.Exchange.class);
               if (exchange != null) {
                  doneUoW(exchange);
         }
         }
         }
      }
      

      minimal example:

       

       

      <cxf:cxfEndpoint id="soap_in1" 
         address="/service1" 
         xmlns:tns="urn:api:service1" 
         wsdlURL="wsdl/service1.wsdl" 
         serviceName="tns:service1" 
         endpointName="tns:HTTP_Port">
         <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
            <entry key="org.apache.cxf.oneway.robust" value="true"/>
         </cxf:properties>
      </cxf:cxfEndpoint>
      <camelContext xmlns="http://camel.apache.org/schema/blueprint"   id="context1">
         <route id="loadTest1">
            <from uri="cxf:bean:soap_in1"/>
            <to uri="log:end"/>
         </route> 
      </camelContext>
      

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              mfilippov Filippov Mihail
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: