JobPersister

JobPersister listens to an XQueue and receives JMS Messages as the job requests. There are two types job requests. The first one is the init request with complete job information. The other is the request on the current job such as a query of the progress data or a command to abort the job, etc. Once the persister gets a job init message, it will initialize the job and starts to process it. Usually, it takes a while to process a job request. While the job is running, the persister is also listening to the XQueue for messages. The most common messages are the queries for progress data on the job. In this case, the persister will load the progress data to the message and removes it from the queue. If the request is to abort the running job, the persister will abort the job and resets the return code. The message will be removed from the queue. In case the message is another job init request while a job is running, the persister will just reset the error code on the message and removes it from the queue. Once the job is done, the job init message will be acknowledged and removed from the queue.

Apart from the common properties, there are many implementation specific properties for JobPersister. Most of them depends on the schemes.
Property Name Data Type Requirement Description Examples
RCField string optional field name to store return code (0 for success) (default: ReturnCode)

JobPersister supports only three types of file based destinations, in terms of the scheme such as ftp, sftp and script. Here is the matrix of supported operations for various schemes:
Scheme Operation Description
ftp/ftps/sftp upload upload the file to a remote server
script test simulates a long running job via sleep for tests

Here is an example of JobPersister:

{
  "Name": "pstr_script",
  "ClassName": "org.qbroker.persister.JobPersister",
  "URI": "script://localhost",
  "LinkName": "script",
  "Operation": "test",
  "ScriptField": "Duration",
  "SessionTimeout": "300",
  "DisplayMask": "6",
  "StringProperty": {
    "Duration": "",
    "Key": ""
  }
}
where it expects the message containing the property of Duration that specifies the number of seconds to sleep.