The FileTransmitter component reads files from the file system and sends their contents to the output port. Data from the source file is read as bytes and is sent to the output port as chunks. The component provides flexible monitoring capabilities and ensures reliable data transfer.

Icon

FileTransmitter and FileReceiver components work together as a unit. These components should not be decoupled.

Configuration and Testing

The Configuration property sheet of File Transmitter is shown in the figure below.


Figure 1: Sample FileTransmitter Configuration

Attributes

Chunk size

Numberofbytesof the source file to be sent in each packet.

Default Value:

100000

Source Configuration

Click the ellipsis button to provide the lcation of the Source directory.

Source directory

The directory from where the FileTransmitter picks the files to be transmitted.

Start timeout

Transmitter sends a Start packet to know the existence of receiver(s). This timeout is the time (in milliseconds) to wait before resending a Start packet.

Default Value:

30000

Packets per update

Numberofpacketstobesent before saving the transfer state to disk.

Default Value:

100

Status on Percentage Increase

Maximumincreaseinpercentage completion before the FileTransmitter sends another status report.

Default Value:

50

Status on Packets Transmitted Count

Maximumincreaseinthe number of chunks sent before the FileTransmitter sends another status report.

Default Value:

1000

Status on Delay Interval

Maximum delay, in milliseconds, before the FileTransmitter sends another status report.

Default Value:

60000

Delay before retransmission

Delay, in milliseconds, after which the FileTransmitter calculates the file status from the receiver and sends retransmissions.

Default Value:

60000

Expert Properties

Enable the Expert Properties view to configure these properties.

Icon
 Expert properties are meant for advanced users; use with caution.


Figure 2: Sample FileTransmitter Configuration

Pre Processing XSL Configuration

Pre Processing XSL configuration can be used to transform request message before processing it. Click the ellipses button against the property to configure the properties.

Refer to the Pre/Post Processing XSL Configuration section under the Common Configurations page for details regarding Pre Processing XSL configuration and Post Processing XSL configuration (below).

Post Processing XSL Configuration

Post Processing XSL configuration can be used to transform the response message before sending it to the output port.

Threadpool Configuration

This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Refer to the Threadpool Configuration section under the Common Configurations page.

Validating the configuration

To validate the configuration, open the CPS after enabling the Use Separate Process CPS option and click the Validate button.


Figure 3: Validating the configuration

Icon

This validation does not check the existence of the destination directory.

FileTransmitter Ports

Input Ports

  • Command - Accepts the commands.
  • Acknowledgement - Receives acknowledgments from the connected FileReceiver component.

Output Ports

  • Data – Sends file data
  • Status – Sends the status of file(s) being transmitted.

FileTransmitter Commands

Send

Initiates the file transfer to the FileReceiver component.

Syntax: Send <sourceFileName> [o/O] [DestinationDirectory]

Examples:

Send Sample.txt o destDir\
Send Sample1.txt O destDir\Sample2.txt
Send Sample1.txt destDir\subDir\Sample2.txt

Icon
  1. [o/O] represents that the file should be overwritten.
  2. Overwrite bit and Destination directory are optional. Absence of Destination directory puts the file in the default destination directory configured in FileReceiver.
  3. In case a Transmitter is transmitting files to a Receiver present on a different type of Operating system, specifying an absolute path for the DestinationDirectory may not work. In such situations, relative path names should be specified (which is appended to the Destination directory configured in Receiver)

Stop

Aborts the transfer of the file specified and sends a kill packet to the connected File receiver which in turn deletes the file being transferred.

Syntax: Stop <sourceFileName>

Example: Stop Sample1.txt

Pause

Puts the FileTransmitter into the paused state, which suspends file transfers until the Resume command is entered.

Syntax: Pause

Resume

Take the FileTransmitter out of the paused state, the file transfers resumes.

Syntax: Resume

Status

 This command sends out:

  • The state of the FileTransmitter (Paused or Running).
  • Names of files for which the transfer has to be resumed (to send the missing packets).
  • Names of files that are yet to be transmitted.

Syntax:  Status

Functional Demonstration

Below figure shows the event process where a FileTransmitter accepts commands from the Feeder and transmits the files to FileReceiver upon request.


Figure 4: Event process showing the File Transfer components

Scenario 1

Transmitting a file.

Sample Input

Below figure shows the sample input from the Feeder.


Figure 5: Sample input from the Feeder

Sample Output

Below figure shows the status messages sent by the FileTransmitter component.


Figure 6: Status messages sent by the FileTransmitter component

Scenario 2

Requesting a report on the current state of FileTransmitter. In this scenario, 1000 send requests are being sent as shown below and then a Status command is sent as shown in the Sample Input to know the files which need data to be resent, the files that are yet to be sent and the current state of transfer (paused/in progress).


Figure 7: Information dialog box

Sample Input


Figure 8: Sample input

Sample Output


Figure 9: Sample output

Useful Tips

  1. Make sure that the three properties Status on Percentage Increase, Status on Packets Transmitted Count, and Status on Delay Interval are configured depending on the requirement. If all the three are set to small values, the component sends many status messages.
  2. If file transfer is across internet, the property Start timeout needs to be tuned appropriately to a higher value in order to avoid FileTransmitter sending multiple Start packets unnecessarily.
  3. The component's cache must always be set to yes, otherwise the component will not be able to resume a transfer on restart.
Icon

To understand the service better, refer the File Transfer example which demonstrates FileTransmitter service features.

Adaptavist ThemeBuilder EngineAtlassian Confluence