Discussion:
autoDelete property in file transport doesn't work
Vincent Vincent
2012-04-04 21:15:42 UTC
Permalink
I think it is a BUG....! I got the same problem, too. Here is my flow & DEBUG message:
<br /><br />
<code>
<br />
&lt;?xml version=&quot;1&#46;0&quot; encoding=&quot;UTF-8&quot;?&gt;
<br /><br />
&lt;mule xmlns=&quot;http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;core&quot; xmlns:sftp=&quot;http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;sftp&quot;
<br />
xmlns:file=&quot;http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;file&quot; xmlns:doc=&quot;http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;documentation&quot;
<br />
xmlns:spring=&quot;http:&#47;&#47;www&#46;springframework&#46;org&#47;schema&#47;beans&quot; xmlns:core=&quot;http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;core&quot;
<br />
xmlns:xsi=&quot;http:&#47;&#47;www&#46;w3&#46;org&#47;2001&#47;XMLSchema-instance&quot; version=&quot;EE-3&#46;2&#46;2&quot;
<br />
xsi:schemaLocation=&quot;
<br />
http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;sftp http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;sftp&#47;current&#47;mule-sftp&#46;xsd
<br />
http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;file http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;file&#47;current&#47;mule-file&#46;xsd
<br />
http:&#47;&#47;www&#46;springframework&#46;org&#47;schema&#47;beans http:&#47;&#47;www&#46;springframework&#46;org&#47;schema&#47;beans&#47;spring-beans-3&#46;0&#46;xsd
<br />
http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;core http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;core&#47;current&#47;mule&#46;xsd
<br />
http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;core http:&#47;&#47;www&#46;mulesoft&#46;org&#47;schema&#47;mule&#47;core&#47;current&#47;mule&#46;xsd &quot;&gt;
<br />
&lt;spring:beans&gt;
<br />
&lt;spring:bean id=&quot;property-placeholder&quot;
<br />
class=&quot;org&#46;springframework&#46;beans&#46;factory&#46;config&#46;PropertyPlaceholderConfigurer&quot;
<br />
doc:name=&quot;Bean&quot;&gt;
<br />
&lt;spring:property name=&quot;location&quot; value=&quot;classpath:db&#46;properties&quot; &#47;&gt;
<br />
&lt;&#47;spring:bean&gt;
<br />
&lt;spring:bean id=&quot;dataSource&quot;
<br />
class=&quot;org&#46;enhydra&#46;jdbc&#46;standard&#46;StandardDataSource&quot; destroy-method=&quot;shutdown&quot;
<br />
doc:name=&quot;Bean&quot;&gt;
<br />
&lt;spring:property name=&quot;driverName&quot; value=&quot;${database&#46;driver}&quot; &#47;&gt;
<br />
&lt;spring:property name=&quot;url&quot; value=&quot;${database&#46;connection}&quot; &#47;&gt;
<br />
&lt;spring:property name=&quot;user&quot; value=&quot;${database&#46;user}&quot; &#47;&gt;
<br />
&lt;spring:property name=&quot;password&quot; value=&quot;${database&#46;password}&quot; &#47;&gt;
<br />
&lt;&#47;spring:bean&gt;
<br />
&lt;&#47;spring:beans&gt;
<br />
&lt;flow name=&quot;sFTPtoLocalFlow1&quot; doc:name=&quot;sFTPtoLocalFlow1&quot;&gt;
<br />
&lt;sftp:inbound-endpoint exchange-pattern=&quot;one-way&quot;
<br />
host=&quot;${sftp&#46;host}&quot; port=&quot;${sftp&#46;port}&quot; path=&quot;${sftp&#46;path}&quot; user=&quot;${sftp&#46;user}&quot;
<br />
password=&quot;${sftp&#46;password}&quot; responseTimeout=&quot;60000&quot; pollingFrequency=&quot;60000&quot;
<br />
fileAge=&quot;6000&quot; sizeCheckWaitTime=&quot;1000&quot; autoDelete=&quot;false&quot;
<br />
doc:name=&quot;SFTP&quot;&gt;
<br />
&lt;file:filename-wildcard-filter pattern=&quot;W42&#46;txt&quot; &#47;&gt;
<br />
&lt;&#47;sftp:inbound-endpoint&gt;
<br />
&lt;file:outbound-endpoint path=&quot;${sftp&#46;out&#46;path}&quot;
<br />
responseTimeout=&quot;10000&quot; doc:name=&quot;File&quot; &#47;&gt;
<br />
&lt;&#47;flow&gt;
<br />
&lt;&#47;mule&gt;
<br /><br />
</code>
<br />
=============================================================
<br />
DEBUG message:
<br />
org.mule.processor.LaxAsyncInterceptingMessageProcessor,
<br />
org.mule.transport.AbstractConnector$DispatcherMessageProcessor
<br />
] with event MuleEvent: 0-38b1a36f-7e98-11e1-8f48-ffe89997f5cb, stop processing=false, sftp://jlee:<a href="mailto:xxx-***@public.gmane.org" rel="nofollow">xxx-***@public.gmane.org</a>:22/HOME/
<br />
DEBUG 2012-04-04 15:53:24,912 [[sftptolocal].sFTPtoLocalFlow1.stage1.03] org.mule.processor.chain.DefaultMessageProcessorChain: Invoking DefaultMessageProcessorChain 'dispatcher processor chain for 'file://C:log''
<br />
[
<br />
org.mule.processor.LaxAsyncInterceptingMessageProcessor
<br />
] with event MuleEvent: 0-38b1a36f-7e98-11e1-8f48-ffe89997f5cb, stop processing=false, sftp://jlee:<a href="mailto:xxx-***@public.gmane.org" rel="nofollow">xxx-***@public.gmane.org</a>:22/HOME/
<br />
DEBUG 2012-04-04 15:53:24,912 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.file.FileConnector: Borrowing a dispatcher for endpoint: file://C:log
<br />
DEBUG 2012-04-04 15:53:24,912 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.file.FileConnector: Borrowed a dispatcher for endpoint: file://C:log = FileMessageDispatcher{this=3052ce, endpoint=file://C:log, disposed=false}
<br />
DEBUG 2012-04-04 15:53:24,912 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.file.FileConnector: Borrowed dispatcher: FileMessageDispatcher{this=3052ce, endpoint=file://C:log, disposed=false}
<br />
DEBUG 2012-04-04 15:53:24,912 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.session.SerializeAndEncodeSessionHandler: Adding serialized and base64-encoded Session header to message: rO0ABXNyACNvcmcubXVsZS5zZXNzaW9uLkRlZmF1bHRNdWxlU2Vzc2lvbi7rdtEW7GGKAwAEWgAFdmFsaWRMAAJpZHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wACnByb3BlcnRpZXN0AA9MamF2YS91dGlsL01hcDtMAA9zZWN1cml0eUNvbnRleHR0ACdMb3JnL211bGUvYXBpL3NlY3VyaXR5L1NlY3VyaXR5Q29udGV4dDt4cAF0ACQzOGIxYTM2ZS03ZTk4LTExZTEtOGY0OC1mZmU4OTk5N2Y1Y2JzcgAlamF2YS51dGlsLkNvbGxlY3Rpb25zJFN5bmNocm9uaXplZE1hcBtz+QlLSzl7AwACTAABbXEAfgACTAAFbXV0ZXh0ABJMamF2YS9sYW5nL09iamVjdDt4cHNyACRvcmcubXVsZS51dGlsLkNhc2VJbnNlbnNpdGl2ZUhhc2hNYXCd0dnvZ0XOAAMAAHhwdww/QAAAAAAAEAAAAAB4cQB+AAh4cHQAEHNGVFB0b0xvY2FsRmxvdzF4
<br />
INFO 2012-04-04 15:53:24,912 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.file.FileConnector: Writing file to: C:\MULEWORKSPACE\sftptolocal\log\W42.txt
<br />
DEBUG 2012-04-04 15:53:42,178 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.sftp.SftpInputStream: Closing the stream for the file W42.txt
<br />
DEBUG 2012-04-04 15:53:42,178 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.sftp.SftpClient: Will try to delete W42.txt
<br />
DEBUG 2012-04-04 15:53:42,210 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.file.FileMessageDispatcher: Closing file
<br />
DEBUG 2012-04-04 15:53:42,225 [[sftptolocal].connector.file.mule.default.dispatcher.01] org.mule.transport.file.FileConnector: Returning dispatcher for endpoint: file://C:log = FileMessageDispatcher{this=3052ce, endpoint=file://C:log, disposed=false}
<br />
DEBUG 2012-04-04 15:54:21,617 [[sftptolocal].connector.sftp.mule.default.receiver.01] org.mule.transport.sftp.SftpMessageReceiver: Pooling. Called at endpoint sftp://jlee_fmis_mn:****@fhwawar1.fhwa.dot.gov:22/HOME/EDS_to_states/
<br />
DEBUG 2012-04-04 15:54:21,617 [[sftptolocal].connector.sftp.mule.default.receiver.01] org.mule.transport.sftp.SftpReceiverRequesterUtil: Checking files at endpoint sftp://jlee_fmis_mn:****@fhwawar1.fhwa.dot.gov:22/HOME/EDS_to_states/ <a href="Loading Image... rel="nofollow"><img alt="" src="Loading Image... /></a>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Vincent Vincent
2012-04-05 16:41:43 UTC
Permalink
I did further investigation and found out that the autoDelete is set to true as default in the SftpConnector class but there is NO logic getting/handling the value from the InboundEndpoint (which is parsed from mule-config.xml). As a result, the autoDelete flag is ALWAYS set to true.
<br /><br />
see: SftpConnector.java, SftpReceiverRequesterUtil.java

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
vake
2013-04-19 21:33:42 UTC
Permalink
You need an sftp connector

<sftp:connector autoDelete="false" name="MySftpConnector"
validateConnections="false" doc:name="SFTP"/>

<sftp:inbound-endpoint exchange-pattern="one-way"
host="${sftp.host}" port="${sftp.port}" path="${sftp.path}"
user="${sftp.user}"
password="${sftp.password}" responseTimeout="60000" pollingFrequency="60000"
fileAge="6000" sizeCheckWaitTime="1000" doc:name="SFTP"
connector-ref="MySftpConnector">




--
View this message in context: http://mule.1045714.n5.nabble.com/RE-autoDelete-property-in-file-transport-doesn-t-work-tp5619031p5717640.html
Sent from the Mule - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...