Before you begin
This example shows how one combination of values in the
Record detection,
Delimiter, and
Delimiter type properties can be
used to extract messages from a file. The example describes the
FileInput node of a message
flow and assumes that the rest of the flow has already been developed.
It is also assumed that a
Windows system
is being used. To complete this example task, you must first have
added a
FileInput node
to a message flow. You also need the following resources:
For more information about configuring the
FileInput node, see
Configuring the FileInput node.
Complete the following steps:
Procedure
- Set the required node properties on the FileInput node. The
following table summarizes the FileInput node properties that
you should set, which tab they appear on and the value that you should
set in order to follow this example:
Tab |
Property |
Value |
Basic |
Input directory |
C:\FileInput\TestDir |
File name or
pattern |
test_input1.xml |
Action on successful
processing |
Move to
Archive Subdirectory |
Replace duplicate
archive files |
Selected |
Input Message Parsing |
Message domain |
XMLNSC |
Message model |
xml1 |
Polling |
Polling interval |
3 |
Retry |
Action on failing
file |
Add Time
Stamp and Move to Backout Subdirectory |
Records and Elements |
Record detection |
Delimited |
Delimiter |
DOS or UNIX
Line End |
Delimiter type |
Postfix |
FTP |
FTP |
Not selected |
- Deploy the message flow to the integration node. See Deploying integration solutions.
Results
The following actions occur when you perform these steps:
- The file is processed. In accordance with the values set in the
properties on the Records and Elements tab,
the FileInput node detects
records that are separated by DOS or UNIX end-of-line
characters and creates a message for each one that it finds. It propagates
three messages to the flow attached to the Out terminal:
- If a flow is attached to the End of Data terminal, the End of
Data message is propagated after the last record in the file has been
processed.
- When processing is complete, the file test_input1.xml is
moved to the mqsiarchive subdirectory, C:\FileInput\TestDir\mqsiarchive\test_input1.xml.
If a file called test_input1.xml already exists
in the mqsiarchive subdirectory, it is overwritten.
- If the message flow fails, retry processing is attempted according
to the values set in the properties of the FileInput node. In this example
task, a time stamp is added to the file name and the file is moved
to the mqsibackout directory. Here is an example
of the path to such a file: C:\FileInput\TestDir\mqsibackout\20070928_150234_171021_test_input1.xml.
What to do next
To see the effects of specifying other combinations of
values in the Record detection, Delimiter, and Delimiter type properties of the FileInput node, see Controlling how files are separated into records.
To extend
this example to process files from within subdirectories, put the
input file in a subdirectory of Input
directory, and select the property Include local subdirectories.