Source:
<code>public void onMessage(Delivery delivery) throws ActiveMQAMQPException { connection.requireInHandler(); Receiver receiver = ((Receiver) delivery.getLink()); if (receiver.current() != delivery) { return; } try { if (delivery.isAborted()) { receiver.advance(); delivery.settle(); if (!receiver.getDrain()) { receiver.flow(1); } return; } else if (delivery.isPartial()) { if (sessionSPI.getStorageManager() instanceof NullStorageManager) { <START> return; <END> } if (currentLargeMessage == null) { long id = sessionSPI.getStorageManager().generateID(); currentLargeMessage = new AMQPLargeMessage(id, delivery.getMessageFormat(), null, sessionSPI.getCoreMessageObjectPools(), sessionSPI.getStorageManager()); currentLargeMessage.addBytes(receiver.recv()); } else { currentLargeMessage.addBytes(receiver.recv()); } return; } AMQPMessage message; if (currentLargeMessage != null) { currentLargeMessage.addBytes(receiver.recv()); receiver.advance(); currentLargeMessage.finishParse(); message = currentLargeMessage; currentLargeMessage = null; } else { ReadableBuffer data = receiver.recv(); receiver.advance(); message = sessionSPI.createStandardMessage(delivery, data); } Transaction tx = null; if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txState = (TransactionalState) delivery.getRemoteState(); tx = this.sessionSPI.getTransaction(txState.getTxnId(), false); } actualDelivery(message, delivery, receiver, tx); } catch (Exception e) { throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e); } }</code><technical_language>I need add some more metrics constitutes a "large" message requires a client strictly adhere max frame size limits other over, send amount. A client split a 4k message 4 1k chunks assuming a message is large based partial lead considering messages meet normal Artemis definition of a large message large. if partial checking if in a complete message meets definition of a large message AMQP max frame size is configurable protocol adapter need a metric partial exceeds consider "not large" prefer store in large message way</technical_language>

Target:
public void onMessage(Delivery delivery) throws ActiveMQAMQPException { connection.requireInHandler(); Receiver receiver = ((Receiver) delivery.getLink()); if (receiver.current() != delivery) { return; } try { if (delivery.isAborted()) { receiver.advance(); delivery.settle(); if (!receiver.getDrain()) { receiver.flow(1); } return; } else if (delivery.isPartial()) { if (sessionSPI.getStorageManager() instanceof NullStorageManager) { return; } if (currentLargeMessage == null) { if (minLargeMessageSize > 0 && delivery.available() >= minLargeMessageSize) { initializeCurrentLargeMessage(delivery, receiver); } } else { currentLargeMessage.addBytes(receiver.recv()); } return; } AMQPMessage message; if (!(sessionSPI.getStorageManager() instanceof NullStorageManager) && currentLargeMessage == null && minLargeMessageSize > 0 && delivery.available() >= minLargeMessageSize) { initializeCurrentLargeMessage(delivery, receiver); } if (currentLargeMessage != null) { currentLargeMessage.addBytes(receiver.recv()); receiver.advance(); currentLargeMessage.finishParse(); message = currentLargeMessage; currentLargeMessage = null; } else { ReadableBuffer data = receiver.recv(); receiver.advance(); message = sessionSPI.createStandardMessage(delivery, data); } Transaction tx = null; if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txState = (TransactionalState) delivery.getRemoteState(); tx = this.sessionSPI.getTransaction(txState.getTxnId(), false); } actualDelivery(message, delivery, receiver, tx); } catch (Exception e) { throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e); } }