Advanced Configuration : Using File Folder Listener Service : How the Listener Service Works
 
Share this page                  
How the Listener Service Works
When a file is placed in a directory that a listener is monitoring, and it matches the criteria (include/exclude patterns), a POST call is made against /jobconfigs/<id>/listener endpoint. The payload is the file contents sent as plain/text. The payload is set as the incoming djmessage body, and any headers that are sent to the listener endpoint will be available as properties on the djmessage. By default, the djmessage name will be msg1, but you can override this through your listener configuration. The message name will be sent over as a query parameter.
For example, if you have a listener configured with the following properties:
id: listener1
name: listener1name
config-id: 10
active: true
delete-files: true
auto-create-directories: false
recursive: false
flatten-directories: false
directory: C:\Program Files\Actian\IntegrationManager\listener\1
include-pattern: ^runme.txt
exclude-pattern: ^skipme.txt
incoming-message-name: msgTest
When a file named “runme.txt” is placed in the directory “C:\Program Files\Actian\IntegrationManager\listener\1,” the following API call is made, which runs a job: POST /jobconfigs/10/listener?messageName=msgTest
Within a DataConnect process, you would have access to the file contents in msgTest body.
Some file metadata is available in msgTest properties.
Example metadata:
Property
Description
Sample Value
fileabsolute
A boolean option specifying whether the consumed file denotes an absolute path or not
true
fileabsolutepath
Only the file name (the name with no leading paths)
C:\Program Files\Actian\IntegrationManager\listener\1\runme.txt
filelastmodified
A long value containing the last modified timestamp of the file
1517516603175
filelength
A long value containing the file size
16
filename
Name of the consumed file as a relative file path with offset from the starting directory configured on the endpoint
runme.txt
filenameconsumed
The name of the file that was consumed
runme.txt
filenameonly
Only the file name (the name with no leading paths)
runme.txt
fileparent
The parent path
C:\Program Files\Actian\IntegrationManager\listener\1
filepath
The file path. For relative files this is the starting directory plus the relative filename. For absolute files this is the absolute path.
C:\Program Files\Actian\IntegrationManager\listener\1\runme.txt
filerelativepath
The relative path
runme.txt