Creating a file listener
Create a file listener to import and process files from another system, for example, you can import data from files that is used to create a work object.
- In the header of Dev Studio, click .
- In the Short description field, enter a meaningful description of the file listener.
- In the Listener Name field, enter a name for the file listener. The name must start with a letter and contain only letters, numbers, ampersands, and hyphens.
- Click Create and open.
- In the Listener nodes section, select how the listener nodes will
start.For Pega Cloud applications, the Node based startup and Host based startup settings are not available.
- Block startup – When this setting is selected, the file listener cannot be started. When this setting is cleared, the file listener starts at system startup or from Admin Studio.
- Run on all nodes – The file listener starts on all servers in the cluster.
- Node based startup – The file listener starts only on
specified nodes.
- In the Node ID field, in a multinode cluster, enter the
node ID of the server host node or nodes where the file listener is to run. When a
server starts, it activates the file listener on the current node if the current node
matches any node in the list. If a node is specified, the current node must match a
name in the list to activate the file listener. If a node is not specified, the file
listener is not activated on any node.
When multiple file listeners monitor the same directory, the order in which messages are processed might not be the same as the order in which they were put into the directory. If your application requires processing files in the order in which they are sent to the email inbox, use a single file listener on one node.
- In the Node ID field, in a multinode cluster, enter the
node ID of the server host node or nodes where the file listener is to run. When a
server starts, it activates the file listener on the current node if the current node
matches any node in the list. If a node is specified, the current node must match a
name in the list to activate the file listener. If a node is not specified, the file
listener is not activated on any node.
- Host based startup – The file listener starts on a
specified number of nodes on specific servers within the cluster.
- In the Host name field, enter the network location name of the host server on which the file listener is to start.
- In the Node count field, enter the number of nodes on which the file listener is to start.
- NodeClassification based startup – The file listener starts
on the specified node types.
- Click Add a row.
- In the Node type field, select the node type on which to start file listener.
- Repeat these steps to add additional node types.
- Optional: Select Reset startup to delete all instances from the Log-Connect-AssignedNodes class so that file listeners can be restarted.
- In the Source properties section, configure the source
properties:
- In the Source location field, enter the file specification
for the file listener to look for input files.The file listener requests require read and write access to this directory. Only use Pega-provided repositories for the source location. You cannot use custom repositories.
This field supports the Global Resource Settings syntax (= PageName.PropertyName ). The default property name for this field is pySourceLocation. For more information, see Using the Global Resource Settings feature.
- In the Source name mask field, enter the filter for
selecting files to process from the source location directory.You can use an asterisk as a wildcard. You can include only one asterisk in the root of the mask (before the period) and one asterisk in the file type. If you do not specify a mask or use a mask of *.*, the file listener selects every file in the source location.
- Optional: To specify whether the file listener processes a file regardless of whether uppercase and lowercase letters appear in the file name, select Disable case sensitivity.
- In the Source location field, enter the file specification
for the file listener to look for input files.
- In the Listener properties section, configure the listener
properties:
- In the Concurrent threads field, enter the number of threads
on each server node that the listener requestor creates when it starts.Enter 1 or a small integer. Each thread operates on a single file. Multithreading has no benefit unless multiple files are available at the same time for processing. If the node on which the file listener runs has available JVM memory and CPU cycles, and multiple files are available for processing, using 2 to 5 threads can increase throughput.
- In the Service package field, select the file service that the file listener links to.
- In the Service class field, select the service class.
- In the Service method field, select the service method.
- In the Concurrent threads field, enter the number of threads
on each server node that the listener requestor creates when it starts.
- If the file service requires requestors to be authenticated, in the Requestor
login section, configure the requestor login information:
- In the Requestor user ID field, select the operator ID that
the file listener uses to log in.The operator ID determines the access group, and therefore the ruleset list, of the file listener.
- In the Password field, enter the password for the operator ID.
- In the Requestor user ID field, select the operator ID that
the file listener uses to log in.
- Click Save.
- Optional: You can test connectivity for all startup modes except Blocked
startup. Click Test connectivity to confirm that your
system can find the directory.The system attempts to create the listener thread on the current node and tries to access the device and directory. The test results are displayed including the parameters used in the test, the steps attempted, and the outcome of each step.
For information about using remote logging to troubleshoot your file listener, see Debugging listeners by using remote logging.
Previous topic Using file listeners Next topic Configuring file listener processing