IBM Support

How to add a user defined message property for a file to message transfer.

Technote (troubleshooting)


You are doing message to file managed transfers using WebSphere MQ File Transfer Edition (WMQ FTE /WMQFTE) with WMQ V7.0 or using Managed File Transfer available in WMQ v7.5 and you want to include a user defined message property for the resulting message.

Resolving the problem

The easiest way to define a custom message property is using the -md flag on the transfer request; for example:

fteCreateTransfer -sa AGENT_JUPITER -da AGENT_SATURN -dq MY_QUEUE@MyQM
-qmp true -md account=123456 /tmp/source_file.txt

The above sends the file named /tmp/source_file.txt to the destination agent AGENT_SATURN and places the file as a message onto queue MY_QUEUE on queue manager MyQM. The message has a user defined property named usr.account in the MD with the value 123456. This is a property in the RFH2 header.

The above is documented WMQ Information Center:

Example: Setting user-defined properties on a file-to-message transfer

To do this via an Ant task, you can use the fte:filecopy or fte:filemove task to accomplish the same. An example fte:filecopy task would be:
<project xmlns:fte="" default="complete">
    <!-- Initialise the properties used in this script.

  <target name="init" description="initialise task properties">
               <property name="src.file" value="/home/user/file1.bin"/>
               <property name="dst.queue" value="TEST.QUEUE@qm2"/>
               <fte:uuid property="" length="8"
<target name="step1" depends="init" description="transfer file">

<fte:filecopy cmdqm="qm0@localhost@1414@SYSTEM.DEF.SVRCONN"
              src="agent1@qm1" dst="agent2@qm2"

<fte:entry name="fileName" value="${FileName}"/>

<fte:filespec srcfilespec="${src.file}" dstqueue="${dst.queue}"



To do the same with a resource monitor and variable substitution, here is an example transfer task XML:

<?xml version="1.0" encoding="UTF-8"?>
"" version="5.00"
" ion ./Monitor.xsd">
 <pollInterval units="minutes">5</pollInterval>
 <batch maxSize="5"/>
   <directory recursionLevel="0">e:\temp</directory>
       <request version="5.00"
           <sourceAgent QMgr="AGENTQM" agent="AGENT1"/>
           <destinationAgent QMgr="AGENTQM" agent="AGENT2"/>
           <transferSet priority="0">
               <metaData key="FileName">${FileName}</metaData>
             <item checksumMethod="MD5" mode="text">
               <source disposition="delete" recursive="false">
               <destination type="queue">
                 <queue persistent="true"

Product Alias/Synonym

WebSphere MQ File Transfer Edition WMQ FTE WMQFTE Managed File Transfer WMQMFT

Document information

More support for: WebSphere MQ
WMQ File Transfer Edition

Software version: 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.5

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Reference #: 1626281

Modified date: 19 March 2013