If the method is not idempotent, the retry mechanism should be disabled by setting "enable=false".
The absence of this annotation implies that the method is idempotent. By default, all methods are idempotent.
If the method is idempotent, it implies that there is no side effect of calling this method more than once. In case the execution of this method results in an abnormal termination, system will retry this method from the beginning as it is safe to do so.
If the method can participate in a global transaction, the system can achieve the non-idempotent behavior in the most reliable way. The execution of the method and the posting of the response, both are done under one global transaction. If any of the steps result in an abnormal termination, the transaction will be rolled back and the method will be executed again in a new transaction. In this case it is guaranteed that the method will be executed only once in a completed transaction and the result of the execution will always be posted only once to the response queue.
If the method cannot participate in a global transaction, then the system will guarantee that the non-idempotent method is executed "at most once". If the method execution does not complete because of some abnormal termination, a fault response will be sent to the callback service. If there is an abnormal termination after completely executing the method but before/while posting the response to the queue then also a fault message will be sent to the callback service.
If this annotation is applied to the class, all the methods inherit the setting. If a method has its own annotation, then the class level annotation ignored.
|Modifier and Type||Optional Element and Description|
Indicates if this method can be safely retried in case of abnormal termination during the execution of this method.
Indicates if this method is capable of participating in the global transaction or not.
public abstract boolean enable
public abstract boolean supportsGlobalTransaction