WSO2 ESB XSLT Mediator creates temp files (never cleaned)

641 views Asked by At

I use WSO2 ESB 4.5.1 on Windows. My problem is that the temp folder WSO2_HOME/tmp is growing up and never cleaned.

I found out that the problem comes from the xslt mediator, everytime it transform a big xml file (~15kb) a new temp file is created.

Does anyone have an idea why these tmp files are not cleaned up?

Proxy:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="input" transports="vfs" startOnLoad="true" trace="disable">
    <parameter name="transport.PollInterval">5</parameter>
    <parameter name="transport.vfs.FileURI">vfs:file://C:/WSO2/Test/From</parameter>
    <parameter name="transport.vfs.FileNamePattern">.*[.].*</parameter>
    <parameter name="transport.vfs.ContentType">application/xml</parameter>
    <target faultSequence="errorSequence">
        <inSequence>
            <log level="full"/>
            <property name="ClientApiNonBlocking" scope="axis2" action="remove"/>
            <property name="OUT_ONLY" value="true"/>   
            <xslt key="avintis_xml_indent"/>
            <property name="transport.vfs.ReplyFileName" expression="fn:concat('out_', $trp:FILE_NAME, '.xml')" scope="transport"/>
            <send>
                <endpoint>
                    <address uri="vfs:file://C:/WSO2/Test/To"/>
                </endpoint>
            </send>
        </inSequence>
    </target>
</proxy>

XSLT:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:avintis="http://www.avintis.com/esb"
  xmlns:urn="urn:hl7-org:v2xml" version="2.0"
  xmlns:payload="http://ws.apache.org/commons/ns/payload">
  <xsl:output method="xml" encoding="UTF-8" indent="yes"/>

  <xsl:template match="*|text()|@*">
    <xsl:copy>
      <xsl:apply-templates select="*|text()|@*"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

inputfile:

any xml file bigger than ~15kb
1

There are 1 answers

0
poohdedoo On

Seems temp files do not get cleaned up by the HouseKeeping Task. To clean them using the housekeeping task you can configure it in the Carbon.xml as shown below.

   <WorkDirectory>${carbon.home}/tmp/work</WorkDirectory>

   <HouseKeeping>

       <AutoStart>true</AutoStart>

       <Interval>10</Interval>

       <MaxTempFileLifetime>30</MaxTempFileLifetime>
   </HouseKeeping>