FileReceiver

FileReceiver is a JMS message producer that monitors a file on a server, retrieves the file and loads the content into a JMS message. The new JMS message will be put into the internal XQueue as the output. It supports flow control and XA. Fault tolerance with auto reconnections is built in.

In case of the script, please make sure to redirect stderr to stdout or close stderr, since FileReceiver only reads from its stdout.

Apart from the common properties, there is at least one implementation specific properties for FileReceiver.
Property Name Data Type Requirement Description Examples
DependencyGroup list optional list of dependencis to monitor the data source see example
Other implementation specific properties depends on the schemes.

FileReceiver supports various types of file based data sources, in terms of the scheme such as file, ftp, sftp, http, https, nntp or script. Here is the matrix of supported operations for various schemes:
Scheme Operation Description
file retrieve retrieve the content from a local file
ftp/ftps/sftp retrieve retrieve the content from a remote file
http/https retrieve retrieve the content from a remote web page
nntp fetch fetch the content from a news group
script retrieve execute the script and put the standout into message body

Here is an example of FileReceiver:

{
  "Name": "rcvr_file",
  "ClassName": "org.qbroker.receiver.FileReceiver",
  "URI": "ftp://panda/www/wdap/rrd/monitor.html",
  "LinkName": "root",
  "Operation": "retrieve",
  "Mode": "daemon",
  "TextMode": "1",
  "XAMode": "0",
  "Username": "qbadm",
  "Password": "xxxx",
  "PauseTime": "30000",
  "StandbyTime": "60000",
  "DisplayMask": "0",
  "StringProperty": {
    "FileName": "/www/wdap/rrd/monitor.html"
  },
  "DependencyGroup": [{
    "Dependency": [{
      "Name": "file",
      "URI": "ftp://panda/www/wdap/rrd/monitor.html",
      "Type": "FileMonitor",
      "User": "qbadm",
      "Password": "xxxx",
      "Timeout": "30",
      "TimeZone": "GMT"
    }]
  }]
}
where the receiver monitors the file on panda. If the file is updated, it will retrieve the file and puts the content into the message.