Example: Transferring a single file to a single message
We can specify a queue as the destination of a file transfer by using the -dq parameter with the fteCreateTransfer command. The source file must be smaller than the maximum message length set on the destination queue. The destination queue does not have to be on the same queue manager as the queue manager that the destination agent connects to, but these two queue managers must be able to communicate.
About this task
The source file is called /tmp/single_record.txt and is located on the same system as the source agent, AGENT_NEPTUNE. The source agent, AGENT_NEPTUNE, uses the queue manager QM_NEPTUNE. The destination agent is AGENT_VENUS and this agent connects to the queue manager QM_VENUS. The destination queue, RECEIVING_QUEUE, is located on the queue manager QM_MERCURY. QM_MERCURY is in the same IBM MQ network as, and can be accessed by, the queue manager QM_VENUS.
Procedure
Type the following command:fteCreateTransfer -sa AGENT_NEPTUNE -sm QM_NEPTUNE -da AGENT_VENUS -dm QM_VENUS -dq RECEIVING_QUEUE@QM_MERCURY /tmp/single_record.txtIf the destination queue is on a different queue manager to the queue manager used by the destination agent we must specify the value of the -dq parameter in the following format queue_name@queue_manager_name. If we do not specify @queue_manager_name in the value, the destination agent assumes that the destination queue is located on the destination agent queue manager. The exception is when the enableClusterQueueInputOutput agent property has been set to true. In this case the destination agent will use standard IBM MQ resolution procedures to determine where the queue is located.
The source agent, AGENT_NEPTUNE, reads the data from the file /tmp/single_record.txt and transfers this data to the destination agent, AGENT_VENUS. The destination agent, AGENT_VENUS, sends the data to a persistent message on the queue RECEIVING_QUEUE@QM_MERCURY. The message does not have an IBM MQ group ID set.
Parent topic: Transfer data from files to messages
Related concepts
Related tasks
- Configure an agent to perform file-to-message transfers
- Example: Splitting a single file into multiple messages by length
- Example: Splitting a text file with a regular expression delimiter and including the delimiter in the messages
- Example: Splitting a text file into multiple messages using a regular expression delimiter
- Example: Setting IBM MQ message properties on a file-to-message transfer
- Example: Setting user-defined properties on a file-to-message transfer
- Starting a new file transfer
Related reference