You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Question:

Is there any way to set multiple destinations/targets in JADE?

Answer:

Within limits. JADE is presently not able to work as an Enterprise Service Bus (ESB). But multiple targets and sources, like an ESB, are on the wish lists of some customers. The idea is to get the data from a source (or multiple sources) and transfer them to e.g. an ftp-server, an smtp-server and to an archive folder on the ftp-server. This will require a "new" kind of customisation and the ini-file approach currently used in JADE is not very helpfull for this kind of customising. We will be changing to a xml-file structure in the future.

Transfer to different destinations on the same server

You can, however, copy or move files to different destinations on the same server. For example, if you want to copy a file after transfer to an additional folder you can use the Post_Command and Pre_Command parameters. These Parameters are available for the source and the target. The command string, defined there, will be executed for each transferred file.

An example for Linux and in Java:

 objOptions.Target().Post_Command.Value("echo 'File: $TargetFileName' >> t.1;cat $TargetFileName >> t.1;rm -f $TargetFileName");
 objOptions.Target().Pre_Command.Value("touch $TargetFileName");

The Post_Command will do a command string which will:

  1. append the text "File: ..." to a file named t.1
  2. append the content of the current targetfile to the t.1 file
  3. remove the current targetfile

"$TargetFileName" is a place holder for the current target file. "$SourceFileName" is the name of the file from the source which is currently transferred.

Another example:

After transfer of a source file the source file should be moved to an archive folder:

 source_PostCommand=mv $SourceFileName  ...

Another way to rename/move (but not copy) on source and/or target is to use the replace and replacing parameters:

 objOptions.Source().replacing.Value("(.*)(.txt)");
 objOptions.Source().replacement.Value("/SAVE/\\1_[date:yyyyMMddHHmm];\\2");

or in INI notiation:

 Source_replacing=(.*)(.txt)
 Source_replacement=/SAVE/\\1_[date:yyyyMMddHHmm];\\2

All Files on source with .txt extension will be moved to /SAVE/ folder and the filename will be extended by a timestamp.

Using this way you can move or copy files in the target folder to any other destination that can be accessed from JADE.

back to list of JADE / SOSFTP FAQs

  • No labels