I am new to the Spring Integration project. I am trying to process remote files (from an SMB2 share) transactionally with the spring-integration-smb
project. With the help of this blog post I was able to process files transactionally (with Spring's PseudoTransactionManager
) on the local filesystem. Now I've tried to adjust the sample to process files on a remote share (SMB), but I haven't found a solution to make to processing transactional. Have you any idea how I can implement such a transactional processing?
You still can use similar approach with a PseudoTransactionManager
and TransactionSynchronizationFactory
combination to track your transaction statuses.
For rollback-kinda operations you can use an SmbRemoteFileTemplate
to call its rename()
, remove()
etc. operations. The failed message contains for you all necessary info in the headers:
messageBuilder.setHeader(FileHeaders.REMOTE_HOST_PORT, uri.getHost() + ':' + uri.getPort())
.setHeader(FileHeaders.REMOTE_DIRECTORY, uri.getPath())
.setHeader(FileHeaders.REMOTE_FILE, uri.getFragment());
Thanks for your answer. That solved my problem.