3

I have a requirement where I want create different files from MQ messages based on the filename in the header. If a file is already existing in the folder location, the message in the queue should be appended to the contents of already existing file, else a new file should be created based on the filename in the header. I do not want to use File node because of some design constraint. I have tried creating MQFTE monitor to test this requirement but the result is: if a file is not existing, a new file is getting created however an existing file is getting overwritten with the new message instead of appending. What would be the best way to address this?

JoshMc
  • 10,239
  • 2
  • 19
  • 38
Hane
  • 43
  • 5
  • Yes, MFT overwrites if the destination file exists, assuming -de overwrite option is used. I think this behavior can be modified by implementing custom DestinationTransferStartExit and DestinationTransferEndExit exits and deploying them at destination agent. In the DestinationTransferStartExit you can rename a file if it exists and then in DestinationTransferEndExit append the newly transferred file to the existing file. – Shashi Mar 08 '22 at 16:31
  • @Shashi Thank you for the pointers. Will check on the DestinationTransfer option – Hane Mar 08 '22 at 17:29
  • I have posted simple exit here - https://github.com/ibm-messaging/mq-mft/tree/master/mft.merge.files. Let me know if it helps – Shashi Mar 09 '22 at 06:54

0 Answers0