Skip to main content

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.

AttributeDescriptionDefault
actionAlias of the Processor, corresponding to the argument passed to the DistributedTransactionCustomProcessor constructornone
sponsorWhether this is the sponsorfalse
transactionTimeoutSecondsTransaction 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 timeout0