Transaction Error Handler Rule Function
You can create a transaction error handler callback rule function that enables you to identify which post RTC transactions failed or which events were not sent out during the post RTC phase. The transaction error handler rule function is invoked each time a database transaction exception occurs, and each time a send event exception occurs.
The behavior of transaction error handler is governed by executing the rule function in a separate thread. The rule function is executed in the separate thread in the following conditions:
- The
Agent.agentclassname.enableParallelOps
property istrue
. See TIBCO BusinessEvents Configuration Guide. - The
Agent.agentclassname.enableParallelOps
property isfalse
but the Concurrent RTC settings is enabled. See TIBCO BusinessEvents Configuration Guide.
The error handler rule function provides full details of the failed transactions. The transaction details provided in this callback function can be used for audit trail purposes. The engine continues retrying the transaction or action as usual.
To Register the Rule Function
To register the rule function, add the following property to the be-engine.tra / project CDD file at an appropriate level (for example, at the cluster level to affect all deployed engines). Set the value to the project path of the error handler rule function:
be.engine.txn.error.function=projectPathToErrorHandlerRuleFunction
Rule Function Signature
The required signature for the error handler rule function is:
int Name (Object txns, int errorType, int errCode, String errMsg, long retryCount)
The return value must be 0 (zero).
Arguments are explained in Transaction Error Handler Rule Function Reference.