1

my spring-boot-integration app, could be running on multiple servers(nodes) but they all are supposed to read a common directory.Now, I wrote a custom locker which takes the lock on file so that any other instance will not be able to process the same file . All spring configuration have been done in xml.

Application acquiring the lock but unable to read the content of locked file.

java.io.IOException: The process cannot access the file because another process has locked a portion of the file

as suggested in forms, we can get access to the locked file content only over ByteBuffer.

so tried to transform the file to bytes using file-to-bytes-transformer and passed as input to outbound gateway. But instance not getting started.

Any suggestion?

<file:file-to-bytes-transformer input-channel="filesOut" output-channel="filesOutChain"/>
       <integration:chain id="filesOutChain" input-channel="filesOutChain"> 
        <file:outbound-gateway id="fileMover" 
            auto-create-directory="true"
            directory-expression="headers.TARGET_PATH"
            mode="REPLACE">
            <file:request-handler-advice-chain>
                <ref bean="retryAdvice" />
            </file:request-handler-advice-chain>
        </file:outbound-gateway>    
        <integration:gateway request-channel="filesChainChannel" error-channel="errorChannel"/>
    </integration:chain>
Jessie
  • 963
  • 5
  • 16
  • 26
  • Any clues with the stack trace from logs? – Artem Bilan Aug 29 '18 at 16:31
  • Looks like you have passed already the problem: https://stackoverflow.com/questions/52080366/passing-renamed-file-as-input-to-outbound-adapter-gateway. May be it's time to delete this question or, please, provide an answer what was a solution? – Artem Bilan Aug 29 '18 at 16:53
  • yes we can delete this question. – Jessie Sep 03 '18 at 13:24

0 Answers0