IBM MQ Managed File Transfer source and destination user exit routines

Directory separators

Directory separators in source file specifications are always represented using forward slash (/) characters, regardless of how you have specified directory separators in the fteCreateTransfer command or in the IBM® MQ Explorer. You must take this into account when you write an exit. For example, if you want to check that the following source file exists: c:\a\b.txt and you have specified this source file using the fteCreateTransfer command or the IBM MQ Explorer, note the file name is actually stored as: c:/a/b.txt So if you search for the original string of c:\a\b.txt, you will not find a match.

Source side exit points

Before the entire file transfer starts
This exit is called by the source agent when a transfer request is next in the list of pending transfers and the transfer is about to start.

Example uses of this exit point are to send files in stages to a directory that the agent has read/write access to using an external command, or to rename the files on the destination system.

Pass the following arguments to this exit:
  • Source agent name
  • Destination agent name
  • Environment metadata
  • Transfer metadata
  • File specifications (including file metadata)
The data returned from this exit is as follows:
  • Updated transfer metadata. Entries can be added, modified, and deleted.
  • Updated list of file specifications, which consists of source file name and destination file name pairs. Entries can be added, modified, and deleted
  • Indicator that specifies whether to continue the transfer
  • String to insert to the Transfer Log.

Implement the SourceTransferStartExit.java interface to call user exit code at this exit point.

After the entire file transfer is complete
This exit is called by the source agent after the entire file transfer has completed.

An example use of this exit point is to perform some completion tasks, such as sending an e-mail or an IBM MQ message to flag that the transfer has completed.

Pass the following arguments to this exit:
  • Transfer exit result
  • Source agent name
  • Destination agent name
  • Environment metadata
  • Transfer metadata
  • File results
The data returned from this exit is as follows:
  • Updated string to insert to the Transfer Log.

Implement the SourceTransferEndExit.java interface to call user exit code at this exit point.

Destination side exit points

Before the entire file transfer starts
An example use of this exit point is to validate the permissions at the destination.
Pass the following arguments to this exit:
  • Source agent name
  • Destination agent name
  • Environment metadata
  • Transfer metadata
  • File specifications
The data returned from this exit is as follows:
  • Updated set of destination file names. Entries can be modified but not added or deleted.
  • Indicator that specifies whether to continue the transfer
  • String to insert into the Transfer Log.

Implement the DestinationTransferStartExit.java interface to call user exit code at this exit point.

After the entire file transfer is complete
An example use of this user exit is to start a batch process that uses the transferred files or to send an e-mail if the transfer has failed.
Pass the following arguments to this exit:
  • Transfer exit result
  • Source agent name
  • Destination agent name
  • Environment metadata
  • Transfer metadata
  • File results
The data returned from this exit is as follows:
  • Updated string to insert to the Transfer Log.

Implement the DestinationTransferEndExit.java interface to call user exit code at this exit point.