Announcement Announcement Module
No announcement yet.
copying files to a different location after consuming Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • copying files to a different location after consuming

    Hi Guys,

    I got a new requirement change for my project. earlier i was using the file inbound adapter and it periodically polled for messages. Once it consumes the message we kept the file as its in the same location. my new requirement is to delete the file from the original location and copy it to some other location, so client can easily figure it out what are the sent files. is there any way of copying files after consuming?


  • #2
    It's available using the transaction synchronization feature in 2.2...

    together with a PseudoTransactionManager.

    2.2. should be released soon; it is currently at RC2.

    For 2.1, you would need to copy the File to a header using a header-enricher; then, at the end of the flow make the last channel a publish-subscribe-channel and add a second subscriber to the channel. Set the current subscriber order="1", then create a second subscriber...

    <int:service-activator order="2" input-channel="lastChannel" 
        expression="headers['savedFile'].renameTo('/completed/' + headers['savedFile'].name" />