Search in sources :

Example 1 with SessionRequestProducerCreditsMessage

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

the class ServerSessionPacketHandler method onSessionRequestProducerCredits.

private void onSessionRequestProducerCredits(Packet packet) {
    this.storageManager.setContext(session.getSessionContext());
    try {
        Packet response = null;
        boolean requiresResponse = false;
        try {
            SessionRequestProducerCreditsMessage message = (SessionRequestProducerCreditsMessage) packet;
            session.requestProducerCredits(message.getAddress(), message.getCredits());
        } 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) SessionRequestProducerCreditsMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage) ActiveMQXAException(org.apache.activemq.artemis.core.exception.ActiveMQXAException) ActiveMQQueueMaxConsumerLimitReached(org.apache.activemq.artemis.api.core.ActiveMQQueueMaxConsumerLimitReached)

Example 2 with SessionRequestProducerCreditsMessage

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

the class ServerPacketDecoder method decodeRequestProducerCreditsMessage.

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

Aggregations

SessionRequestProducerCreditsMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage)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