Class TransactionImpl
java.lang.Object
org.apache.pulsar.client.impl.transaction.TransactionImpl
- All Implemented Interfaces:
io.netty.util.TimerTask,org.apache.pulsar.client.api.transaction.Transaction
public class TransactionImpl
extends Object
implements org.apache.pulsar.client.api.transaction.Transaction, io.netty.util.TimerTask
The default implementation of
Transaction.
All the error handling and retry logic are handled by this class. The original pulsar client doesn't handle any transaction logic. It is only responsible for sending the messages and acknowledgements carrying the transaction id and retrying on failures. This decouples the transactional operations from non-transactional operations as much as possible.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionabort()<T> booleancheckIfOpen(CompletableFuture<T> completableFuture) commit()org.apache.pulsar.client.api.transaction.TxnIDgetTxnID()registerAckedTopic(String topic, String subscription) voidregisterAckOp(CompletableFuture<Void> ackFuture) registerProducedTopic(String topic) voidregisterSendOp(CompletableFuture<org.apache.pulsar.client.api.MessageId> sendFuture) voidrun(io.netty.util.Timeout timeout)
-
Method Details
-
run
- Specified by:
runin interfaceio.netty.util.TimerTask- Throws:
Exception
-
registerProducedTopic
-
registerSendOp
-
registerAckedTopic
-
registerAckOp
-
commit
- Specified by:
commitin interfaceorg.apache.pulsar.client.api.transaction.Transaction
-
abort
- Specified by:
abortin interfaceorg.apache.pulsar.client.api.transaction.Transaction
-
getTxnID
public org.apache.pulsar.client.api.transaction.TxnID getTxnID()- Specified by:
getTxnIDin interfaceorg.apache.pulsar.client.api.transaction.Transaction
-
checkIfOpen
-