Search in sources :

Example 6 with SessionXAResponseMessage

use of org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAResponseMessage in project activemq-artemis by apache.

the class ActiveMQSessionContext method xaCommit.

@Override
public void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException {
    SessionXACommitMessage packet = new SessionXACommitMessage(xid, onePhase);
    SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
    if (response.isError()) {
        throw new XAException(response.getResponseCode());
    }
    if (logger.isTraceEnabled()) {
        logger.trace("finished commit on " + ClientSessionImpl.convert(xid) + " with response = " + response);
    }
}
Also used : SessionXAResponseMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAResponseMessage) XAException(javax.transaction.xa.XAException) SessionXACommitMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXACommitMessage)

Example 7 with SessionXAResponseMessage

use of org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAResponseMessage in project activemq-artemis by apache.

the class ActiveMQSessionContext method xaPrepare.

@Override
public int xaPrepare(Xid xid) throws XAException, ActiveMQException {
    SessionXAPrepareMessage packet = new SessionXAPrepareMessage(xid);
    SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
    if (response.isError()) {
        throw new XAException(response.getResponseCode());
    } else {
        return response.getResponseCode();
    }
}
Also used : SessionXAPrepareMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAPrepareMessage) SessionXAResponseMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAResponseMessage) XAException(javax.transaction.xa.XAException)

Aggregations

SessionXAResponseMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAResponseMessage)7 XAException (javax.transaction.xa.XAException)5 Packet (org.apache.activemq.artemis.core.protocol.core.Packet)2 SessionXAJoinMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAJoinMessage)2 SessionXAResumeMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAResumeMessage)2 SessionXARollbackMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXARollbackMessage)2 SessionXAStartMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionXAStartMessage)2 List (java.util.List)1 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)1 ActiveMQIOErrorException (org.apache.activemq.artemis.api.core.ActiveMQIOErrorException)1 ActiveMQQueueMaxConsumerLimitReached (org.apache.activemq.artemis.api.core.ActiveMQQueueMaxConsumerLimitReached)1 ActiveMQXAException (org.apache.activemq.artemis.core.exception.ActiveMQXAException)1 ActiveMQExceptionMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage)1 CreateAddressMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage)1 CreateQueueMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage)1 CreateQueueMessage_V2 (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2)1 CreateSharedQueueMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage)1 CreateSharedQueueMessage_V2 (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage_V2)1 NullResponseMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage)1 RollbackMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.RollbackMessage)1