Before you begin
Put a file on the file system that is local to the integration
node, for the FileRead node
to read. Here is an example of the file contents:
<Data>Purchase details</Data>
In
this example, the contents of the data in the data tag are inserted
into the incoming message. Any valid XML structures can be added to
this section.
Make a note of the path to the file. For example: c:\temp\FileRead\task3.xml or /tmp/FileRead/task3.
Create
the following queues on the integration node queue manager:
- FILEREAD.TASK3.IN1
- FILEREAD.TASK3.OUT1
Detailed information about configuring the node is given on
the property panels for the node, in the IBM® Integration Toolkit.
Procedure
- Create a message flow that contains an MQInput node, a FileRead node, and an MQOutput node.
- Wire the terminals as follows:
- Wire the Out terminal of the MQInput node to the In terminal
of the FileRead node.
- Wire the Out terminal of the FileRead to the In terminal
of the MQOutput node.
- Configure the MQInput node:
- On the Basic panel, set the Queue name to FILEREAD.TASK3.IN1
- On the Input Message Parsing panel set the domain to XMLNSC.
- Configure the FileRead node.
- On the Basic panel, set the directory and file name to refer
to the XML file. For example: c:\temp\FileRead and task3.xml or /tmp/FileRead and task3.
- Configure the Result panel:
- Set the Result data location to $ResultRoot/XMLNSC/Data
- Set the Output data location to $InputRoot/XMLNSC/Data
- Configure the Input Message Parsing panel:
- Set the Domain to XMLNSC
- Configure the MQOutput node:
- On the Basic panel, set the Queue name to FILEREAD.TASK3.OUT1
- Deploy the message set and message flow.
- Change the Directory and Name fields to the correct location
of the file, and then put the following XML message onto queue FILEREAD.TASK2.IN1:
<Invoice>
<Directory>c:\temp\FileRead</Directory>
<Name>task2.xml</Name>
<Data/>
</Invoice>
Results
The integration node routes the message to the queue FILEREAD.TASK3.OUT1
and inserts data from the file into the Data field of the output message:
<Invoice>
<Directory>c:\temp\FileRead</Directory>
<Name>task2.xml</Name>
<Data>Purchase details</Data>
</Invoice>