|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
Duplicate messages should be detected and discarded to avoid processing the same event more than once. Duplicate detection is performed when a process instance executes its first Checkpoint activity. You must specify a value for the duplicateKey element in the Checkpoint activity input schema. This value should be some unique key contained in the event data that starts the process. For example, the orderID value is unique for all new orders.
2.
3. The process engine checks the current list of duplicateKey values for a matching value.
a. If no process instance has stored the given duplicateKey value, the process engine stores the value and completes the Checkpoint activity.
b. If another process instance has already stored the given duplicateKey value, the process engine terminates the process and throws a DuplicateException.
4. Once a process engine stores a duplicateKey value and performs the Checkpoint for a process instance, no other Checkpoint activities in the process instance can be used to store a different duplicateKey value.Using the algorithm described above, process engines can guarantee that no newly created or recovered process instances will execute if they have the same duplicateKey value. Therefore, you should take care in choosing the value of duplicateKey and ensure that it will be unique across all process instances.
See TIBCO ActiveMatrix BusinessWorks Administration for more information on specifying process engine storage.Duplicate detection is only as efficient as the duplicateKey that is specified. You should try to pick a value that is unique for every message. For example, you may select the JMSMessageID header property for JMS messages. In the example in the previous section, orderID is unique for each incoming order, so that would be a good choice for the value of the duplicateKey.The following illustrates specifying orderID from the example above as the duplicateKey value in the Checkpoint activity.Transaction groups using certain transaction types can allow Checkpoint activities to be performed as part of the transaction. In this case, the checkpoint performed for the transaction may be the first checkpoint in the process definition. If this is the case, you can specify the duplicateKey as part of the transaction group configuration. The duplicateKey is specified in the Checkpoint Duplicate Detection Key field of the transaction group.When a duplicate is detected, the Checkpoint activity fails with the DuplicateException. You can place an error transition from the Checkpoint activity to a series of activities to handle the duplicate message. If no error transition is specified, the process instance terminates and duplicate messages are effectively ignored.
• bw.engine.dupKey.enabled — specifies whether duplicate detection is performed.
• bw.engine.dupKey.timeout.minutes — specifies how long (in minutes) to keep stored duplicateKeys. The default is 30 minutes.0 indicates the duplicateKey is removed when the job is removed. However, if bw.engine.enableJobRecovery=true, the job is not automatically removed after a failure so the duplicateKey will remain as long as the job remains. Such a job can be restarted or purged later.-1 indicates to store duplicateKey values indefinitely.
• bw.engine.dupKey.pollPeriod.minutes — specifies the number of minutes to wait before polling for expired duplicateKey values.See TIBCO ActiveMatrix BusinessWorks Administration for more information about setting process engine properties.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |