File Receiver Adapter should not Create the file in Append Mode
I have the following requirement:
BS1 sends data to PO from which PO creates a file, then BS2 sends data to PO and PO appends the first data file with the contents received from BS2 and sends data to a SFTP server.
In case either of the BSs dont send data on any particular day, no file should be sent to the SFTP server.
Solution I have proposed is
Use 2 different file receiver channels for each BSs, in Create mode for BS1 and Append mode for BS2. This works fine when both ssystems send data. However the challenge is, even if BS1 sends no data, the channel for BS2 will create the file, even in the Append mode, which is not desirable.
Can you suggest a solution to the above challenge?
I could achieve this using advanced selection of source files, with additionalFilesOptional flag set to 'false'. Also I used 2 different file receiver channels to be able to read one file at a time alongwith checking the existence of the second file.