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

User-defined metadata is set as an IBM MQ message property on the first message written to the destination queue by the transfer. IBM MQ message properties enable an application to select messages to process, or to retrieve information about a message without accessing IBM MQ Message Descriptor (MQMD) or MQRFH2 headers.


About this task

Include the parameters -qmp true and -md account=123456 in the fteCreateTransfer command, to set the usr.account property to 123456 in the RFH2 header.


Procedure

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

In addition to the standard set of IBM MQ message properties, the user-defined property is set in the message header of the first message written by the destination agent, AGENT_SATURN, to the queue, MY_QUEUE, on queue manager, MyQM. The header is set to the following value:
usr.account=123456

The prefix usr is added to the beginning of the name of the user-defined metadata.

Parent topic: Transfer data from files to messages


Related concepts


Related tasks


Related information