Class ProtonTransactionImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
-
- org.apache.activemq.artemis.protocol.amqp.proton.transaction.ProtonTransactionImpl
-
- All Implemented Interfaces:
Transaction
public class ProtonTransactionImpl extends TransactionImpl
AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled or not. This class extends the Core TransactionImpl used for normal TX behaviour. In the case where deliveries have been settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, we increment the delivery count and return to the consumer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.activemq.artemis.core.transaction.Transaction
Transaction.State
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
storageManager
-
-
Constructor Summary
Constructors Constructor Description ProtonTransactionImpl(Xid xid, StorageManager storageManager, int timeoutSeconds, AMQPConnectionContext connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDelivery(org.apache.qpid.proton.engine.Delivery delivery, ProtonServerSenderContext context)voidcommit()RefsOperationcreateRefsOperation(Queue queue, AckReason reason)voiddischarge()Map<MessageReference,Pair<org.apache.qpid.proton.engine.Delivery,ProtonServerSenderContext>>getDeliveries()booleanisDischarged()voidrollback()-
Methods inherited from class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
addOperation, afterCommit, afterStore, commit, doCommit, doRollback, getAllOperations, getCreateTime, getID, getProperty, getProtocolData, getState, getXid, hasTimedOut, hasTimedOut, isContainsPersistent, isEffective, markAsRollbackOnly, prepare, putProperty, resume, setContainsPersistent, setProtocolData, setState, setTimeout, suspend, toString, tryRollback
-
-
-
-
Constructor Detail
-
ProtonTransactionImpl
public ProtonTransactionImpl(Xid xid, StorageManager storageManager, int timeoutSeconds, AMQPConnectionContext connection)
-
-
Method Detail
-
createRefsOperation
public RefsOperation createRefsOperation(Queue queue, AckReason reason)
- Specified by:
createRefsOperationin interfaceTransaction- Overrides:
createRefsOperationin classTransactionImpl
-
rollback
public void rollback() throws Exception- Specified by:
rollbackin interfaceTransaction- Overrides:
rollbackin classTransactionImpl- Throws:
Exception
-
addDelivery
public void addDelivery(org.apache.qpid.proton.engine.Delivery delivery, ProtonServerSenderContext context)
-
getDeliveries
public Map<MessageReference,Pair<org.apache.qpid.proton.engine.Delivery,ProtonServerSenderContext>> getDeliveries()
-
commit
public void commit() throws Exception- Specified by:
commitin interfaceTransaction- Overrides:
commitin classTransactionImpl- Throws:
Exception
-
isDischarged
public boolean isDischarged()
-
discharge
public void discharge()
-
-