- Configuration and Testing
- Component Configuration
- Error handling configuration
- File Path
- Sort Keys
- Field Names
- Field Delimiter
- Record Delimiter
- Throttling Interval(ms)
- Output Format
- OutputFile Directory
- Send Empty Message when No Records Present ?
- Threadpool Configuration
- Component Configuration
- Functional Demonstration
The TextSplitter microservice splits the incoming messages and then groups those messages based on Sort keys values provided to generate the output in a TEXT/XML format. This microservice is used specifically to handle a huge volume of files.
Configuration and Testing
The figure below illustrates the Component Properties Sheet (CPS) properties.
Figure 1: Component Configuration properties
Error handling configuration
The remedial actions to be taken when a particular error occurs can be configured using this attribute.
Click the ellipsis button against this property to configure Error Handling properties for different types of Errors. By default, the options Log to error logs, Stop service and Send to error port are enabled.
Path of the input file to be chosen.
The microservice runs on the peer server and therefore the file paths and directories mentioned in the CPS should be valid on the machine where the peer server is running. If the microservice fails over to another peer server, ensure that the machine on which the secondary peer server is running carries the same path.
Is Header Included?
if enabled, the headers are picked from the first NON-empty line of the input file.
The sort keys are used to sort the file.These should be provided as a comma-separated list. They must be sub-fields of headers group. The order in which they are provided reflects on the output.
if Is Header Included property is disabled, then the user needs to provide all the headers in comma-separated list present in the input file. This property is hidden when Is Header Included property is enabled.
Field Delimiter to separate the fields in a record. If the user wants to give a delimiter consisting spaces, it should be wrapped in double quotes. For example, a single-spaced delimiter should be given as " ", although tab could be given as \t
Delimiter used to separate the Records, by default it is set to \n.
The minimum interval between two consecutive messages that are sent to the output port.
Choose the Format of the message from the options available:
Provide the Root name for the XML Output messages.
Provide the Target NameSpace for the generated XML Output.
The directory contains the sorted file as per the given keys with Timestamp appended to it.If this property is left empty, a temporary directory from runtime data is chosen.The file created shall be deleted after the execution of the request
Send Empty Message when No Records Present ?
If the file is empty without any entry in it, the output for the respective output format will be as below:
- XML: a recordset with empty data for the fields is sent to the output port.
- TEXT: an empty record is sent with headers.
This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective.
Click the Threadpool Configuration ellipsis button to configure the Threadpool Configuration properties.
Figure 2: Threadpool Configuration
Enable Thread Pool
Enable this option to configure the properties that appear as below.
The number of requests to be processed in parallel within the component. Default value is '1'.
Batch Eviction Interval (in ms)
Time in milliseconds after which the threads are evicted in case of inactivity. New threads are created in place of evicted threads when new requests are received. Default value is '1000'.
The following flow shows the TextSplitter taking an input from a CSV file and giving an XML output.
Figure 3: Sample Flow set for the demonstration
The headers are read from the input. LocationID, CheckID are given as Sort Keys, with throttling message =1 ms
The temporary outputFile gets created in the Output folder which will be deleted after the execution of the request.
Figure 4: Input data for the Sample Flow sent through the Feeder microservice
The messages that match the LocationID and CheckId are grouped and sent to the output port.
Figure 5: Output for the Sample Flow displayed in the Display microservice