Details
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:
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>