Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Question
Is there any way to set multiple destinations/targets in YADE?
Answer
Within limits. YADE 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 users. 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 a different FTP server. This will require a new kind of configuration and the ini-file approach currently used in YADE is not very helpful for this kind of customising. We will be changing to a xml configuration files 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 then 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 in Java:
Code Block | ||
---|---|---|
| ||
objOptions.Target().Post_Command.Value("echo 'File: $TargetFileName' >> t.1;cat $TargetFileName >> t.1;rm -f $TargetFileName"); objOptions.Target().Pre_Command.Value("touch $TargetFileName"); |
...
$TargetFileName
is a variable name (place holder) for the current target file. $SourceFileName
is the name of the file from the source that is currently transferred.
More examples:
After transfer of a source file the source file should be moved to an archive folder:
...