dawdler-distributed-transaction-api
Module Introduction
The classes and annotations shared across the distributed transaction framework.
1. Adding the dependency in pom
<groupId>club.dawdler</groupId>
<artifactId>dawdler-distributed-transaction-api</artifactId>
2. The DistributedTransaction annotation
@DistributedTransaction is applied to the methods of the transaction sponsor and the transaction participants.
| Attribute | Description | Default |
|---|---|---|
| action | Alias of the Processor, corresponding to the argument passed to the DistributedTransactionCustomProcessor constructor | none |
| sponsor | Whether this is the sponsor | false |
| transactionTimeoutSeconds | Transaction timeout (seconds); branches still in the trying state after this time are forcibly rolled back by the compensator. 0 means using the global default value defaultTransactionTimeoutSeconds. A timeout declared by the sponsor applies to all branches of the whole transaction, while a participant's declared timeout only takes effect when the sponsor has not declared one. Long transactions that may run longer than the default 300 seconds should declare a larger timeout | 0 |