Stream File Reader Pattern
Discover more about the Stream File Reader Pattern component and how to use it on the Digibee Integration Platform.
Last updated
Discover more about the Stream File Reader Pattern component and how to use it on the Digibee Integration Platform.
Last updated
Stream File Reader Pattern reads a local text file in blocks of line according to the configured pattern and triggers subpipelines to process each message. This resource must be used for large files.
Take a look at the configuration parameters of the component. Parameters supported by Double Braces expressions are marked with (DB)
.
Parameter | Description | Default value | Data type |
---|---|---|---|
File Name substitutes the local pattern file.
total: total number of processed lines.
success: total number of successful processed lines.
failed: total number of lines of whose processing failed.
To know if a line has been correctly processed, each processed line must return { "success": true }
.
The component throws an exception if the File Name doesn't exist or can't be read.
The files manipulation inside a pipeline occurs in a protected way. All the files can be accessed with a temporary directory only, where each pipeline key gives access to its own files set.
Stream File Reader Pattern makes batch processing. To better understand the process, read the documentation.
See below how the component behaves in a determined situation and what its respective configuration is.
Given that the following XML file must be read:
file.xml
Configuring the component to return just the XML block of the order
tag:
File Name: file.xml
Tokenizer: XML
Token: order
The result will be 2 subflows containing the values that are inside the order
tag:
First:
Second:
file.txt
File Name: file.txt
Tokenizer: PAIR
Token: ###
End Token: --###
Include Tokens: deactivated
The result will be 3 subflows containing the values that are inside the start (###
) and end tokens (--###
):
First:
Second:
Third:
file.txt
The following pattern must be searched:
ID-\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
File Name: file.txt
Tokenizer: REGEX
Token: ID-\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
The result will be 2 subflows containing the values that match with the informed REGEX pattern.
First:
Second:
file.txt
The following pattern must be searched:
ID-\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
File Name: file.txt
Tokenizer: REGEX
Token: ID-\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
Group: 2
The result will be 1 subflow containing the values that match the informed REGEX pattern.
When the REGEX Tokenizer is used to group, the pattern found as output is shown.
If the pattern informed in the file isn't found, then the return will be an execution of the whole file. Be careful when specifying the REGEX.