Search in sources :

Example 1 with SessionAcknowledgeMessage

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

the class ServerSessionPacketHandler method onSessionAcknowledge.

private void onSessionAcknowledge(Packet packet) {
    this.storageManager.setContext(session.getSessionContext());
    try {
        Packet response = null;
        boolean requiresResponse = false;
        try {
            final SessionAcknowledgeMessage message = (SessionAcknowledgeMessage) packet;
            requiresResponse = message.isRequiresResponse();
            this.session.acknowledge(message.getConsumerID(), message.getMessageID());
            if (requiresResponse) {
                response = new NullResponseMessage();
            }
        } catch (ActiveMQIOErrorException e) {
            response = onActiveMQIOErrorExceptionWhileHandlePacket(e, requiresResponse, response, this.session);
        } catch (ActiveMQXAException e) {
            response = onActiveMQXAExceptionWhileHandlePacket(e, requiresResponse, response);
        } catch (ActiveMQQueueMaxConsumerLimitReached e) {
            response = onActiveMQQueueMaxConsumerLimitReachedWhileHandlePacket(e, requiresResponse, response);
        } catch (ActiveMQException e) {
            response = onActiveMQExceptionWhileHandlePacket(e, requiresResponse, response);
        } catch (Throwable t) {
            response = onCatchThrowableWhileHandlePacket(t, requiresResponse, response, this.session);
        }
        sendResponse(packet, response, false, false);
    } finally {
        this.storageManager.clearContext();
    }
}
Also used : ActiveMQIOErrorException(org.apache.activemq.artemis.api.core.ActiveMQIOErrorException) ActiveMQException(org.apache.activemq.artemis.api.core.ActiveMQException) NullResponseMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage) ActiveMQXAException(org.apache.activemq.artemis.core.exception.ActiveMQXAException) SessionAcknowledgeMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage) ActiveMQQueueMaxConsumerLimitReached(org.apache.activemq.artemis.api.core.ActiveMQQueueMaxConsumerLimitReached)

Example 2 with SessionAcknowledgeMessage

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

the class ServerPacketDecoder method decodeSessionAcknowledgeMessage.

private static SessionAcknowledgeMessage decodeSessionAcknowledgeMessage(final ActiveMQBuffer in, CoreRemotingConnection connection) {
    final SessionAcknowledgeMessage acknowledgeMessage = new SessionAcknowledgeMessage();
    acknowledgeMessage.decode(in);
    return acknowledgeMessage;
}
Also used : SessionAcknowledgeMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage)

Aggregations

SessionAcknowledgeMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage)2 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 NullResponseMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage)1