Version: 17.07
Supported Since: 17.01
The File Ingress Connector can be used to obtain messages from a local file system and inject those messages to the UltraESB-X engine. The connector has tested on Linux, Windows and OS-X environments and it is supposed to be able to operate in almost all the existing file systems.
When receiving a file to the UltraESB-X through the local file transport, the file will be set as the payload of a message and that message will be injected to the engine. Therefore users should be able to access the received file by accessing the message payload within the configured message flow and do required modifications.
In order to use the File Ingress Connector, you must first select the Local File Connector dependency from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add the Local File Connector dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list, select the Local File Connector dependency. |
Processor |
Message will be emitted from this out port with the content of the file as the payload of the message |
On Exception |
The message will be emitted from this out port, if an error occurred while creating the payload from the file. |
* marked fields are mandatory
File Path * |
Basic |
Absolute file path to the base directory that the file ingress connector is supposed to pick files |
||
File Name Pattern |
Basic |
Regex pattern to filter out the files from the above configured file fetching location.
All the files which are matched to this regex expression will be fetched from the above configured |
||
File Path Pattern |
Basic |
Other than the absolute location provided as the |
||
Wait After Modification |
File Modifications |
This is a time period in seconds which will be used to decide whether to fetch a file or not based on its last modified time of the file. Framework will not fetch a given fill until current time exceeds, the summation of the last modified time of the file and this value. By default, this value is zero. |
||
Remove Original File |
File Modifications |
Specify whether to remove the original file after fetching it for processing. If this is set to
|
||
Move After Process |
File Modifications |
File path to move input file in the file system, after completing the processing successfully. This path will be considered only if the file was successfully processed without any errors. Unless this value is an absolute path, it will be computed relative to the directory from which the file was picked.
|
||
Move After Failure |
File Modifications |
File path to move the fetched input file in the file system, after completing the processing with failures. This path will be considered only if a failure was encountered while processing the file. Unless this value is an absolute path, it will be computed relative to the directory from which the file was picked.
|
||
Move Timestamp Format |
File Modifications |
Set to attach the current timestamp in this format to the file name as a suffix, while moving files both in success and failure scenarios. If this is not set, original file name will be used as it is while moving. |
||
Scheduler Configuration |
Scheduling |
Bean reference of the scheduler configuration bean which should be declared as a resource in the project.xpml file. By default there is internal scheduler configuration within the framework which will be shared by all the polling connectors. If you need to configure higher level of concurrent processing threads which will fetch the files from local file system, you can configure your own thread pool configuration while declaring the parameters of the scheduler configuration bean as below.
In this configuration,
|
||
Polling Cron Expression |
Scheduling |
Cron expression for the database table querying schedule. Cron expression should be a valid Quartz cron expression since the Framework is underneath using Quartz to extract the schedule from the cron expression. |
||
Polling Start Delay |
Scheduling |
Delay in milliseconds to start the polling schedule. Any iteration which comes within this time period from the startup time of the framework, won’t be considered as a valid file polling iteration. |
||
Polling Repeat Interval |
Scheduling |
Interval in milliseconds for the next iteration of the polling schedule. This will be considered if there isn’t a configured cron schedule. |
||
Polling Repeat Count |
Scheduling |
Number of iterations which should go through the polling schedule. If this is set to 1 which means only the first iteration of the polling schedule will be considered as a valid file polling iteration and all other iterations of the schedule will be ignored. By default, this value is set to -1 which means it will consider all the iterations of the polling schedule as a valid iteration. |
||
Concurrent Polling Count |
Scheduling |
Maximum number of concurrent threads which can be used to poll the configured path to fetch files from the local file system. By default, this value is 1. |
||
Concurrent Execution Limit |
Scheduling |
Maximum number of concurrent threads which can be used process the fetched files from the local file system. By default, this value is 4. |
In this sample use case, let’s use File Ingress Connector to pull files with .csv and .xml extensions and then log the message message payload to the console and then send the payload to an external HTTP server. The sample integration flow should look as below.
The files will be picked up from /tmp/files
directory and it is specified as the File Path
. The 'File Name Pattern'
should be .*\.(xml|csv)
, because we onl want files wilt .csv or .xml extensions. Below image shows the
property configuration of the File Ingress Connector.
Further, in the Log processing element we configure to log the message payload and the HTTP Egress Connector is configured to send the message to an Echo Server. The Successful flow end processing element is added to complete the integration flow.