Interface TransactionBuilder
The builder to build a transaction for Pulsar.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the transaction with the configured settings.withTransactionTimeout
(long timeout, TimeUnit timeoutUnit) Configure the maximum amount of time that the transaction coordinator will for a transaction to be completed by the client before proactively aborting the ongoing transaction.
-
Method Details
-
withTransactionTimeout
Configure the maximum amount of time that the transaction coordinator will for a transaction to be completed by the client before proactively aborting the ongoing transaction.The config value will be sent to the transaction coordinator along with the CommandNewTxn. Default is 60 seconds.
- Parameters:
timeout
- the transaction timeout valuetimeoutUnit
- the transaction timeout unit- Returns:
- the transaction builder itself
-
build
CompletableFuture<Transaction> build()Build the transaction with the configured settings.- Returns:
- a future represents the result of starting a new transaction
-