FilePersister

FilePersister is a JMS message consumer that persists the content of the messages to a file based destination. It listens to the XQueue and receives JMS Messages as the requests. Either it stores the content of the message on a remote server as a file, or it downloads file from a remote server according to the content of the message. In case of download, FilePersister puts the downloaded content to the message body and removes it from the XQueue. On the other end of the XQueue, the node is supposed to retrieve the downloaded content from the message. FilePersister supports flow control and allows object control from its owner. It is fault tolerant with retry and idle options.

Apart from the common properties, there are many implementation specific properties for FilePersister. Most of them depends on the schemes.
Property Name Data Type Requirement Description Examples
Retry integer optional number of retry before to give up the delivery 2
RCField string optional field name to store return code (0 for success) (default: ReturnCode)
Template string optional template to build the request

FilePersister supports various types of file based destinations, 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 store store the content to a local file
file download download the content from a local file
ftp/ftps/sftp store store the content to a remote file
ftp/ftps/sftp download download the content from a remote file
ftp/ftps/sftp list list all the files on a remote location
http/https store post the content to a remote web page
http/https download download the content from a remote web page
nntp post post the content to a news group
nntp retrieve retrieve the topic from a new group
script execute execute the script and put the standout into message body

Here is an example of FilePersister:

{
  "Name": "pstr_rest",
  "ClassName": "org.qbroker.persister.FilePersister",
  "URI": "http://panda/S60App/dynamicmessagesenderservlet.jsp",
  "LinkName": "rest",
  "Operation": "store",
  "SOTimeout": "300",
  "XAMode": "1",
  "Retry": "1",
  "Template": "##body##",
  "DisplayMask": "6",
  "StringProperty": {
    "AssetID": "",
    "Type": "",
    "status": ""
  }
}
where it expects the message body containing the query string as the request and sends the rest call to the service.