Package org.apache.activemq.broker
Class TransactionBroker
java.lang.Object
org.apache.activemq.broker.BrokerFilter
org.apache.activemq.broker.TransactionBroker
This broker filter handles the transaction related operations in the Broker
interface.
-
Field Summary
Fields inherited from class org.apache.activemq.broker.BrokerFilter
next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(ConsumerBrokerExchange consumerExchange, org.apache.activemq.command.MessageAck ack) Used to acknowledge the receipt of a message by a client.voidbeginTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) Starts a transaction.voidcommitTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid, boolean onePhase) Commits a transaction.voidforgetTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) Forgets a transaction.org.apache.activemq.command.TransactionId[]getPreparedTransactions(ConnectionContext context) Gets a list of all the prepared xa transactions.getTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid, boolean mightBePrepared) intprepareTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) Prepares a transaction.voidremoveConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) A client is disconnecting from the broker.voidremoveTransaction(org.apache.activemq.command.XATransactionId xid) voidrollbackTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) Rollback a transaction.voidsend(ProducerBrokerExchange producerExchange, org.apache.activemq.command.Message message) Send a message to the broker to using the specified destination.voidstart()Recovers any prepared transactions.voidstop()protected voidverifyUncommittedCount(ProducerBrokerExchange producerExchange, Transaction transaction, org.apache.activemq.command.Message message) Methods inherited from class org.apache.activemq.broker.BrokerFilter
addBroker, addConnection, addConsumer, addDestination, addDestinationInfo, addProducer, addSession, brokerServiceStarted, fastProducer, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getNext, getPeerBrokerInfos, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageDispatched, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeConsumer, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, virtualDestinationAdded, virtualDestinationRemoved
-
Constructor Details
-
TransactionBroker
-
-
Method Details
-
start
Recovers any prepared transactions.- Specified by:
startin interfaceorg.apache.activemq.Service- Overrides:
startin classBrokerFilter- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Overrides:
stopin classBrokerFilter- Throws:
Exception
-
getPreparedTransactions
public org.apache.activemq.command.TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception Description copied from interface:BrokerGets a list of all the prepared xa transactions.- Specified by:
getPreparedTransactionsin interfaceBroker- Overrides:
getPreparedTransactionsin classBrokerFilter- Parameters:
context- transaction ids- Returns:
- array of TransactionId values
- Throws:
Exception- TODO
-
beginTransaction
public void beginTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception Description copied from interface:BrokerStarts a transaction.- Specified by:
beginTransactionin interfaceBroker- Overrides:
beginTransactionin classBrokerFilter- Parameters:
context- connection contextxid- transaction id- Throws:
Exception- TODO
-
prepareTransaction
public int prepareTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception Description copied from interface:BrokerPrepares a transaction. Only valid for xa transactions.- Specified by:
prepareTransactionin interfaceBroker- Overrides:
prepareTransactionin classBrokerFilter- Parameters:
context- connection contextxid- transaction id- Returns:
- id
- Throws:
Exception- TODO
-
commitTransaction
public void commitTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid, boolean onePhase) throws Exception Description copied from interface:BrokerCommits a transaction.- Specified by:
commitTransactionin interfaceBroker- Overrides:
commitTransactionin classBrokerFilter- Parameters:
context- connection contextxid- transaction idonePhase- is COMMIT_ONE_PHASE- Throws:
Exception- TODO
-
rollbackTransaction
public void rollbackTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception Description copied from interface:BrokerRollback a transaction.- Specified by:
rollbackTransactionin interfaceBroker- Overrides:
rollbackTransactionin classBrokerFilter- Parameters:
context- connection contextxid- transaction id- Throws:
Exception- TODO
-
forgetTransaction
public void forgetTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception Description copied from interface:BrokerForgets a transaction.- Specified by:
forgetTransactionin interfaceBroker- Overrides:
forgetTransactionin classBrokerFilter- Parameters:
context- connection contextxid- transaction id- Throws:
Exception- TODO
-
acknowledge
public void acknowledge(ConsumerBrokerExchange consumerExchange, org.apache.activemq.command.MessageAck ack) throws Exception Description copied from interface:RegionUsed to acknowledge the receipt of a message by a client.- Specified by:
acknowledgein interfaceRegion- Overrides:
acknowledgein classBrokerFilter- Parameters:
consumerExchange- the environment the operation is being executed under.- Throws:
Exception- TODO
-
send
public void send(ProducerBrokerExchange producerExchange, org.apache.activemq.command.Message message) throws Exception Description copied from interface:RegionSend a message to the broker to using the specified destination. The destination specified in the message does not need to match the destination the message is sent to. This is handy in case the message is being sent to a dead letter destination.- Specified by:
sendin interfaceRegion- Overrides:
sendin classBrokerFilter- Parameters:
producerExchange- the environment the operation is being executed under.- Throws:
Exception- TODO
-
verifyUncommittedCount
protected void verifyUncommittedCount(ProducerBrokerExchange producerExchange, Transaction transaction, org.apache.activemq.command.Message message) throws Exception - Throws:
Exception
-
removeConnection
public void removeConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) throws Exception Description copied from interface:BrokerA client is disconnecting from the broker.- Specified by:
removeConnectionin interfaceBroker- Overrides:
removeConnectionin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.info- metadata about the Brokererror- null if the client requested the disconnect or the error that caused the client to disconnect.- Throws:
Exception- TODO
-
getTransaction
public Transaction getTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid, boolean mightBePrepared) throws jakarta.jms.JMSException, XAException - Throws:
jakarta.jms.JMSExceptionXAException
-
removeTransaction
public void removeTransaction(org.apache.activemq.command.XATransactionId xid)
-