With the eiConsole’s Directory/File Listener (Adapter) You Can Periodically Poll a Directory for a File or Set of Files That Will Be Picked Up and Used to Initiate a Transaction
The Directory/File Listener (Adapter) allows the eiConsole and eiPlatform to periodically poll a Directory for a file or set of files that will be picked up and used to initiate a transaction. The Directory/File Listener component of the eiConsole provides a graphical Interface with easy to configure screens.
Listener (Adapter) Configuration Drop-Down List
The Directory/File Listener offers nine tabs for configuring the behavior: Basic, Advanced, Transaction Logging, Inactivity, Throttling, Post-Process, Scheduling, Criteria, and Sorting.
Basic Directory/File Listener Configuration Options
The Basic tab includes the required Polling Interval for how often to scan the Directory.
Directory/File Listener Basic Configuration Options
The Polling Directory allows you to specify which Directory you would like to poll. Click on the three dots to the right of the Directory name in order to show the window below.
Select the Polling Directory File
Features such as the File Name restriction allow you to specify a set of characters required in the file name. The File Extension Restriction allows you to specify the file extensions that you will process. Tokenizers allow you to specify a character after which to split the file into multiple Transactions. By default, the eiConsole will treat the entire file as the data stream to be handled as 1 message. However, if each line of the file represents a different record you would enter a value, such as the new line delimiter, in this space.
Example of Basic Configuration Options
Advanced Directory/File Listener Configuration Options
The Advanced tab allows you to specify whether or not you should only run the Listener when it is triggered externally, how many elements should be serialized, and whether or not to also scan subfolders.
Also, you can set the following options:
- Initialize on Trigger Only – if enabled, the Listener doesn’t start up until a trigger initializes it
- Allow Command-Line Invocation – if enabled, the listener can be invoked using the CLI client application
- Restart on Listening Error – if enabled, the listener will be restarted after an error occurs
- Stop if Directory Not Found – listener will stop and report an error when polling directory, or postprocess Target directory do not exist
- FIFO Queue Name – the FIFO option enables a “First In, First Out” queuing mechanism between Listeners and Transports. If a FIFO Queue Name is provided, it will be used as a key for a transaction queue. Transactions will be written to this queue before they reach a Transport. The transactions in this queue will be ordered according to when they were created by the Listener.
- FIFO Queue Delay – it is the interval between updates/checks against that queue. Providing a queue name guarantees that a given Transport sends transactions in the same order the Listener created them in.
- Max Transaction per Run – specifies the maximum number of transactions to process at a time
- Include Subfolders – this specifies whether or not subfolders should be searched for files
Directory/File Listener Advanced Configuration Options (top half of screen)
- Full Folder Path Restriction – a Regex expression which must be contained by the full folder path of the file to be picked up (typically will only be used if you are using the ‘Include Subfolders’ option)
- Include Hidden Files – this specifies whether or not hidden files should be retrieved by the Listener
- Combine File Into One Stream – this reads in all matching files as a single stream
- Number of Header Lines – this is the number of lines to treat as header lines. The header of the first file is included and skipped in all other files.
- Synchronous – the Listener waits for a synchronous response before continuing to process the next file. Max Transactions per Run setting must be set to 1 to enable synchronous mode.
- Synchronous Timeout – time in seconds to wait for a synchronous response before timing out
Directory/File Listener Listener Advanced Configuration Options (bottom half of screen)
Transaction Logging Directory/File Listener Configuration Options
On the Transaction Logging tab, you are allowed to enable transaction events logging. That data can be logged by a TransactionEventListener.
- Transaction Logging Enabled – this checkbox allows transaction events originating from this Listener to be logged by a TransactionEventListener
- Log Transaction Data – if enabled, logs transaction data body
- Log Transaction Data Base64 – if enabled, logs transaction data body as Base64
- Log Transaction Attribute – if enabled, logs transaction attributes
- Log All Attributes – if enabled, no attributes will be filtered
- Allowed Attributes – attributes which are allowed to be logged
Directory/File Listener Transaction Logging Configuration Options
Inactivity Directory/File Listener Configuration Options
On the Inactivity tab, you are allowed to specify:
- Enable Inactivity Monitor – Check this box to enable inactivity monitoring. This will throw a non-transaction exception if the specified number of transactions haven’t been processed in the specified time interval.
- Min. Transactions to Expect – the number of transactions to expect to be completed per monitoring interval
- Monitoring Interval – how often to check the specified number of transactions that have been processed
- Times to Monitor – if set, monitoring will be done during the defined times of the day. To ignore, set start and end time equally.
- Days to Exclude from Monitoring – inactivity monitoring will not occur on the days specified
- Include Errors in Transaction Count – if checked, transactions that attempted to start, but failed at the Listener stage, will also be counted
Directory/File Listener Inactivity Configuration Options
Throttling Directory/File Listener Configuration Options
On the Throttling tab, you are allowed to specify:
- Throttling Mode – the throttling mode to use for limiting the number of transactions or messages emitted by this Listener. “Timed” will limit transactions based on time intervals, while “Concurrent” will limit based on a concurrent number of transactions. “Concurrent” mode requires a Throttling Response Processor step later in your interface workflow to acknowledge completion.
Directory/File Listener Throttling Mode
- Throttling Mechanism – the mechanism to use for throttling messages. “Blocking” prevents the Listener from continuing to process and emit messages altogether, while “Queued” pushes received messages into the interface queue or a default, in-memory queue.
- Max Concurrent Messages – how many messages can be concurrently processed, either by time-based limits (“Allow X per Second”) or synchronous (“Allow X at any Time”)
- Timed Emission Interval – the interval for time-based limits (“Allow X per X Timed Emission Interval”)
- Synchronous Timeout Interval – the interval to wait for a synchronous response before failing
Directory/File Listener Throttling Configuration Options
Post-Process Directory/File Listener Configuration Options
The Post-Process tab allows you to specify the behavior of the system after a file has been picked up by the Listener. You can delete or move the file.
Directory/File Listener Post-Process Configuration Options
If you choose to move a file, the Target Directory field is required. This allows you to specify the directory to use for the processed files.
Select the Target Directory
Scheduling Directory/File Listener Configuration Options
The Scheduling tab allows you to specify the start times and end times for the scheduled execution (choose the three dots to the right of the field in order to see this window). Also, you can specify days of the week or particular dates to exclude from scheduling. The Time Zone drop-down menu allows you to specify the Time Zone that should be used for scheduling; by default, it is set to the Time Zone of the console during initial configuration.
Directory/File Listener Scheduling Configuration Options
Criteria Directory/File Listener Configuration Options
On the Criteria tab, you are allowed to specify:
- Minimum Seconds Since File Modified – minimum number of seconds elapsed since file modified
- Minimum Days Since File Modified – minimum number of days elapsed since file modified
- Maximum Days Since File Modified – maximum number of days elapsed since file modified
Directory/File Listener Criteria Configuration Options
Sorting Directory/File Listener Configuration Options
On the Sorting tab, you are allowed to specify:
- File Sorting Method – sorting method for the order in which files are read: System Default or Modified Time.
- Sorting Direction – direction of the selected sorting method: Ascending or Descending.
Directory/File Listener Sorting Configuration Options