Integration Server 10.7 | JMS Client Development Guide | Exactly-Once Processing for JMS Triggers | Document History Database for Use with JMS Triggers
 
Document History Database for Use with JMS Triggers
 
What Happens when the Document History Database Is Not Available for a JMS Trigger?
Managing the Size of the Document History Database
Clearing Expired Entries from the Document History Database
The document history database maintains a history of the persistent messages processed by JMS triggers. Integration Server adds an entry to the document history database when a trigger service begins executing and when it executes to completion (whether it ends in success or failure). The document history database contains message processing information only for triggers for which the Use history property is set to true.
The database saves the following information about each message:
*Trigger ID. Universally unique identifier for the JMS trigger processing the message.
*UUID or JMSMessageID. Universally unique identifier for the message. If the sending client assigned a value to the uuid field in the message, Integration Server uses the uuid value to identify the message. If the uuid field is empty, Integration Server uses the value of the JMSMessageID field in the message header to identify the message.
*Processing Status. Indicates whether the trigger service executed to completion or is still processing the message. An entry in the document history database has either a status of “processing” or a status of “completed.” Integration Server adds an entry with a “processing” status immediately before executing the trigger service. When the trigger service executes to completion, Integration Server adds an entry with a status of “completed” to the document history database.
*Time. The time the trigger service began executing. The document history database uses the same time stamp for both entries it makes for a message. This allows Integration Server to remove both entries for a specific message at the same time.
To determine whether a message is a duplicate of one already processed by the JMS trigger, Integration Server checks for the message’s UUID (or JMSMessageID) in the document history database. The existence or absence of the message’s UUID (JMSMessageID) can indicate whether the message is new or a duplicate.
If the UUID or JMSMessageID...
Then Integration Server...
Does not exist
Assigns the message a status of New and executes the trigger service. The absence of the UUID (JMSMessageID) indicates that the trigger has not processed the message before.
Exists in a “processing” entry and a “completed” entry
Assigns the message a status of Duplicate. The existence of the “processing” and “completed” entries for the message’s UUID (JMSMessageID) indicate the trigger processed the message successfully already. Integration Server acknowledges the message, discards it, and writes a journal log entry indicating that a duplicate message was received.
Existing in a “processing” entry only
Cannot determine the status of the message conclusively. The absence of an entry with a “completed” status for the UUID (JMSMessageID) indicates that the trigger service started to process the message but did not finish. The trigger service might still be executing or the server might have unexpectedly shut down during service execution.
If a document resolver service is specified for the JMS trigger, Integration Server invokes it. If a document resolver service is not specified, Integration Server assigns the message a status of In Doubt, acknowledges the message, and writes a journal log entry stating that an In Doubt message was received.
Exists in a “completed” entry only
Determines the message is a Duplicate. The existence of the “completed” entry indicates the JMS trigger processed the message successfully already. Integration Server acknowledges the message, discards it, and writes a journal log entry indicating that a Duplicate message was received.
Note:Integration Server also considers a message to be In Doubt when the value of the message’s UUID (or JMSMessageID) exceeds 96 characters. If specified, Integration Server executes the document resolver service to determine the message’s status. Otherwise, the Integration Server logs the message as In Doubt.
If you want to use document history to ensure exactly-once processing for some or all of your JMS triggers, you or the server administrator must create the Document History database component and connect it to a JDBC connection pool. For information about configuring the document history database, refer to Installing Software AG Products.