How can TIBCO ActiveMatrix® Adapter for Files transfer files from one location to another by publishing the messages on a TIBCO Enterprise Message Service™ queue with SFT mode without using a subscriber.
book
Article ID: KB0086959
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for Files for Unix and Windows
-
Not Applicable
-
Description
Description: On some occasions, a TIBCO ActiveMatrix® Adapter for Files subscriber may not be interested in receiving a file transfer from a publisher. This can be achieved by requesting that the publisher skip the particular input file or setting expiration time on EMS Server side.
Resolution
Resolution: ========== Any of solutions below can be used to transfer files from one location to another by publishing the messages on a TIBCO Enterprise Message Service™ (EMS) queue with SFT mode without using a subscriber.
1). Skipping the Input File (using a pre-processing script).
If you want to only transfer the file from one location to another without any changes in the file you can use the following method:
You have to make TIBCO ActiveMatrix® Adapter for Files (FA) skip the particular file by using a pre-processing script. The script checks whether a certain file is present in current directory. If it is then instruct the FA to skip the input file. In order to skip the file we need to pass the argument %ScriptStatusFile% in the 'Pre Processing Arguments' field. This creates a temporary status file in the working directory at runtime. Also, we need to append a "Skip the input file" message to the status message file.
The script prints all the arguments and then adds the line ‘skip the input file’ to status file (which is argument 2 and substituted automatically at runtime). Example script follows: *** echo "Arguments arg0=%0 arg1=%1, arg2=%2" if exist abc.txt echo "Skip the input file" >>%2 *** Using the above script, the FA skips the input file if abc.txt is present in the current working directory and moves the file to the directory specified in the field of 'error directory' under 'processing' tab.
2). The other method to transfer files from one location to another by publishing the messages on an EMS queue with SFT mode without using a subscriber and automatically removing the accumulated messages from the EMS queue: You can set a time to live (TTL) on messages or expiration on the destination level. If you set a time to live (TTL) on messages or expiration on the destination level, when the EMS server expires them if the time limit has been exceeded, it reports that xxx messages expired. Here is an excerpt on JMSExpiration of messages from TIBCO EMS User's Guide.
JMSExpiration: Length of time that message will live before expiration. If set to 0, message does not expire. The time-to-live is specified in milliseconds.If the server expiration property is set for a destination, it will override the JMSExpiration value set by the message producer. In EMS version 4.4 and later, clients automatically synchronize their clocks with the server when a connection is created. However, for long-lasting connections, Network Time Protocol (NTP) is the most reliable method for ensuring continuing synchronization between server and client. Additionally, if your EMS server or client application are based on a version of EMS prior to 4.4, you must ensure that clocks are synchronized among all the host computers that send and receive messages, if your client application uses non-zero values for message expiration. Synchronize clocks to a tolerance that is a very small fraction of the smallest message expiration time.
Issue/Introduction
How can TIBCO ActiveMatrix® Adapter for Files transfer files from one location to another by publishing the messages on a TIBCO Enterprise Message Service™ queue with SFT mode without using a subscriber.