JMSPersister

JMSPersister is a JMS message consumer that persists messages to a JMS Queue. It receives JMS messages from the internal XQueue and delivers them to the destination. JMSPersister supports all JMS implentations via JNDI. Only one operation, put, is supported for now. It also supports flow control and XA. Fault tolerance with auto reconnections is built in.

JMSPersister has two stage retries. The first stage of retry is to reopen the queue up to Tolerance times. Between the reopens, it will sleep for PauseTime milli-seconds. If all the reopen fails, the retry enters into the second stage, reconnections. It will reconnect up to MaxRetry times. Between the reconnections, it will sleep for StandbyTime milli-seconds. Then it all the reconnection fails, it will sleep (QuietPeriod + 1) * StandbyTime milli-seconds. Then try to reconnect up to MaxRetry times. So by default, the sleep between the first reconnection and the second is about 75 seconds.

Apart from the common properties, there are many implementation specific properties for JMSPersister.
Property Name Data Type Requirement Description Examples
ContextFactory string mandatory for JNDI initial context factory for JNDI service com.sun.jndi.fscontext.RefFSContextFactory
URLPkgs string optional url pkg prefixes for JNDI org.jboss.naming
Principal string optional security pricipal for JNDI admin
Credentials string optional security credentials for JNDI admin
ConnectionFactoryName string mandatory for JNDI connection factory for JNDI TestConnectionFactory
QueueName string mandatory JMS queue json_in
Priority integer of 0-9 optional new priority to set on messages 5 (default: no change)
Persistence integer of 1,2 optional new persistence to set on messages 2 (default: no change)
Expiry integer optional milliseconds to add to message's expiration time 60000 (default: no change)
RCField string optional for query or request field name to store return code (0 for success) (default: ReturnCode)
MSField string optional for query field name to store MSQL statement (default: MSQL)
ResultField string optional for query field name to store the number of msgs returned (default: MsgCount)
ResultType integer optional for query type of the result 4 for XML (default: 1)
Template string optional for query template for MSQL statement
ResponseProperty list optional for request list of property fields copied from response msg see example
where most of the implementation specific properties are for JNDI service.

Beside of generic JMS implementations, there is also a dedicate implementation for IBM WebSphere MQ. For IBM WebSphere MQ, here are the vendor-specific properties for JMSPersister.
Property Name Data Type Requirement Description Examples
QueueManager string mandatory for binding mode name of the Queue Manager BROKER1
HostName string mandatory for client mode hostname broker1
Port integer optional port number for WMQ 1418 (default: 1414)
ChannelName string optional name of the WMQ SVRCONN channel TEST (default: SYSTEM.DEF.SVRCONN)
SecurityExit string optional classname of the securit exit org.qbroker.wmq.SimpleSecurityExit
SecurityData string optional argument passed into the securit exit
where SecurityExit specifies the full classname for WMQ authentications.

Here is an example of JMSPersister:

{
  "Name": "pstr_json",
  "ClassName": "org.qbroker.persister.JMSPersister",
  "URI": "wmq://pandan1",
  "QueueName": "JSON_IN",
  "Operation": "put",
  "LinkName": "JSON_IN",
  "XAMode": "2",
  "Persistence": "1",
  "DisplayMask": "22",
  "Tolerance": "0",
  "MaxRetry": "2"
}