I have a spring integration file that using inbound adapter reads some files from local directory and then stores it in couchdb. I would want to delete it in the end. In my properties file , I used delete.source.files=true. However, this doesnt seem to work. I read in other stackflow questions that i could use ExpressionEvaluatingRequestHandlerAdvice. I used it with my inboundchanneladapter, but it does not work.
<file:inbound-channel-adapter id="filesInput" expression= "headers['file_originalFile'].delete()?null:null"
directory="file:${incoming.path}/${tw.instance}" queue-size="8"
filename-pattern="*.json" prevent-duplicates="true" channel="filesIn" >
<int:poller id="poller" fixed-rate="${file.read.interval.millis}"
task-executor="pollerExecutor" />
</file:inbound-channel-adapter>
any other way of deleting it? what is wrong with the expression. I'm new to spring integration. thanks in advance.