Getting started using Ant scripts with WebSphere MQ File Transfer Edition
Using Ant scripts with WebSphere® MQ File Transfer Edition allows you to coordinate complex file transfer operations from an interpreted scripting language.
Ant scripts
Ant scripts (or build files) are XML documents defining one or more targets. These targets contain task elements to run. WebSphere MQ File Transfer Edition provides tasks which you can use to integrate file transfer function into Apache Ant. To learn about Ant scripts, see the Apache Ant project web page: http://ant.apache.org/
Examples of Ant scripts that use WebSphere MQ File Transfer Edition tasks are provided with your product installation in the directory install_dir/samples/fteant
On protocol bridge agents, Ant scripts are run on the protocol bridge agent system. These Ant scripts do not have direct access to the files on the FTP or SFTP server.
Namespace
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:fte="antlib:com.ibm.wmqfte.ant.taskdefs" default="do_ping">
<target name="do_ping">
<fte:ping cmdqm="qm@localhost@1414@SYSTEM.DEF.SVRCONN" agent="agent1@qm1" rcproperty="ping.rc" timeout="15"/>
</target>
</project>
The attribute xmlns:fte="antlib:com.ibm.wmqfte.ant.taskdefs" tells
Ant to look for the definitions of tasks prefixed by fte in
the library com.ibm.wmqfte.ant.taskdefs. You do not need to use fte as your namespace prefix; you can use any value. The namespace prefix fte is used in all examples and sample Ant scripts.
Running Ant scripts
To run Ant scripts that contain the file transfer Ant tasks use the fteAnt command. For example:fteAnt -file ant_script_location/ant_script_name
For
more information, see fteAnt (run Ant tasks in a WebSphere MQ File Transfer Edition environment).Return codes
The file transfer Ant tasks return the same return codes as the WebSphere MQ File Transfer Edition commands. For more information, see Return codes for WebSphere MQ File Transfer Edition.