Class AMQPLargeMessage
- java.lang.Object
-
- org.apache.activemq.artemis.api.core.RefCountMessage
-
- org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage
-
- org.apache.activemq.artemis.protocol.amqp.broker.AMQPLargeMessage
-
- All Implemented Interfaces:
org.apache.activemq.artemis.api.core.Message,org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage,org.apache.activemq.artemis.core.server.LargeServerMessage
public class AMQPLargeMessage extends AMQPMessage implements org.apache.activemq.artemis.core.server.LargeServerMessage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage
AMQPMessage.MessageDataScanningStatus
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage
address, ADDRESS_PROPERTY, applicationProperties, applicationPropertiesPosition, connectionID, coreMessageObjectPools, DEFAULT_MESSAGE_FORMAT, DEFAULT_MESSAGE_PRIORITY, deliveryAnnotations, deliveryAnnotationsForSendBuffer, deliveryAnnotationsPosition, encodedDeliveryAnnotationsSize, encodedHeaderSize, expiration, expirationReload, extraProperties, header, headerPosition, logger, MAX_MESSAGE_PRIORITY, memoryEstimate, messageAnnotations, messageAnnotationsPosition, messageDataScanned, messageFormat, messageID, modified, properties, propertiesPosition, rejectedConsumers, remainingBodyPosition, scheduledTime, VALUE_NOT_PRESENT
-
Fields inherited from interface org.apache.activemq.artemis.api.core.Message
BYTES_TYPE, DEFAULT_TYPE, EMBEDDED_TYPE, HDR_ACTUAL_EXPIRY_TIME, HDR_BRIDGE_DUPLICATE_ID, HDR_CONTENT_TYPE, HDR_DUPLICATE_DETECTION_ID, HDR_GROUP_ID, HDR_GROUP_SEQUENCE, HDR_INGRESS_TIMESTAMP, HDR_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIG_ROUTING_TYPE, HDR_ORIGINAL_ADDRESS, HDR_ORIGINAL_QUEUE, HDR_PREFIX, HDR_ROUTE_TO_ACK_IDS, HDR_ROUTE_TO_IDS, HDR_ROUTING_TYPE, HDR_SCALEDOWN_TO_IDS, HDR_SCHEDULED_DELIVERY_TIME, HDR_VALIDATED_USER, INTERNAL_PROPERTY_NAMES_PREDICATE, LARGE_EMBEDDED_TYPE, MAP_TYPE, memoryOffset, OBJECT_TYPE, STREAM_TYPE, TEXT_TYPE
-
-
Constructor Summary
Constructors Constructor Description AMQPLargeMessage(long id, long messageFormat, org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools, org.apache.activemq.artemis.core.persistence.StorageManager storageManager)AMQPLargeMessage(long id, long messageFormat, org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools, org.apache.activemq.artemis.core.persistence.StorageManager storageManager, org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody largeBody)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBytes(byte[] bytes)voidaddBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer bytes, boolean initialHeader)voidaddBytes(org.apache.qpid.proton.codec.ReadableBuffer data)voidcheckReference(org.apache.activemq.artemis.core.server.MessageReference reference)This method check the reference for specifics on protocolData.voidclearPendingRecordID()org.apache.activemq.artemis.api.core.Messagecopy()org.apache.activemq.artemis.api.core.Messagecopy(long newID)org.apache.activemq.artemis.api.core.Messagecopy(long newID, boolean isDLQOrExpiry)voiddeleteFile()protected voidencodeMessage()protected voidensureDataIsValid()org.apache.activemq.artemis.core.io.SequentialFilegetAppendFile()org.apache.qpid.proton.codec.ReadableBuffergetData()intgetEncodeSize()org.apache.activemq.artemis.core.persistence.impl.journal.LargeBodygetLargeBody()org.apache.activemq.artemis.core.message.LargeBodyReadergetLargeBodyReader()intgetMemoryEstimate()longgetPendingRecordID()longgetPersistentSize()org.apache.activemq.artemis.core.persistence.Persister<org.apache.activemq.artemis.api.core.Message>getPersister()intgetPersistSize()intgetPositionAfterDeliveryAnnotations()during large message deliver, we need this calculation to place a new delivery annotationio.netty.buffer.ByteBufgetSavedEncodeBuffer()org.apache.activemq.artemis.core.persistence.StorageManagergetStorageManager()longgetWholeMessageSize()booleanhasPendingRecord()io.netty.buffer.ByteBufinspectTemporaryBuffer()This is used on test assertions to make sure the buffers are released correctedbooleanisDurable()booleanisLargeMessage()booleanisReencoded()voidmessageChanged()protected io.netty.buffer.ByteBufnewHeaderWithoutExpiry(java.util.concurrent.atomic.AtomicInteger placeOutput)voidparseHeader(org.apache.qpid.proton.codec.ReadableBuffer buffer)protected voidparseLargeMessage(byte[] data, boolean initialHeader)protected voidparseLargeMessage(org.apache.activemq.artemis.api.core.ActiveMQBuffer data, boolean initialHeader)protected voidparseLargeMessage(org.apache.qpid.proton.codec.ReadableBuffer data)voidpersist(org.apache.activemq.artemis.api.core.ActiveMQBuffer targetRecord)protected voidreadSavedEncoding(io.netty.buffer.ByteBuf buf)voidreencode()voidreferenceOriginalMessage(org.apache.activemq.artemis.api.core.Message original, org.apache.activemq.artemis.api.core.SimpleString originalQueue)protected voidreleaseComplete()voidreleaseEncodedBuffer()voidreleaseEncodedBufferAfterWrite()getSavedEncodeBuffer()will retain two counters from the buffer, one meant for the call, and one that must be released only after encoding.voidreleaseResources(boolean sync, boolean sendEvent)voidreloadPersistence(org.apache.activemq.artemis.api.core.ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)voidsetFileDurable(boolean value)voidsetPaged()voidsetPendingRecordID(long pendingRecordID)voidsetReencoded(boolean reencoded)voidsetStorageManager(org.apache.activemq.artemis.core.persistence.StorageManager storageManager)org.apache.activemq.artemis.api.core.ICoreMessagetoCore(org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)org.apache.activemq.artemis.api.core.MessagetoMessage()voidvalidateFile()-
Methods inherited from class org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage
acceptsConsumer, addAnnotationsAsProperties, cachedAddressSimpleString, clearInternalProperties, containsProperty, containsProperty, createDeliveryCopy, createExtraProperties, ensureMessageDataScanned, ensureScanning, getAddress, getAddressSimpleString, getAMQPUserID, getAnnotation, getApplicationProperties, getApplicationPropertiesMap, getBody, getBooleanProperty, getBooleanProperty, getBrokerProperty, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getConnectionID, getCorrelationID, getDataScanningStatus, getDecodedApplicationProperties, getDecodedMessageAnnotations, getDeliveryAnnotations, getDeliveryAnnotationsForSendBufferSize, getDoubleProperty, getDoubleProperty, getDuplicateProperty, getEstimateSavedEncode, getExpiration, getExtraBytesProperty, getExtraProperties, getFloatProperty, getFloatProperty, getFooter, getGroupID, getGroupSequence, getHeader, getIngressTimestamp, getIntProperty, getIntProperty, getLastValueProperty, getLongProperty, getLongProperty, getMessageAnnotation, getMessageAnnotation, getMessageAnnotations, getMessageAnnotationsMap, getMessageFormat, getMessageID, getObjectProperty, getObjectProperty, getObjectPropertyForFilter, getOwner, getPriority, getProperties, getPropertyKeysPool, getPropertyNames, getPropertyValuesPool, getProtocolName, getProtonMessage, getReplyTo, getRoutingType, getScheduledDeliveryTime, getSendBuffer, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getUserID, hasScheduledDeliveryTime, internalPersistSize, lazyDecodeApplicationProperties, lazyDecodeApplicationProperties, lazyScanAfterReloadPersistence, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putCharProperty, putCharProperty, putDoubleProperty, putDoubleProperty, putExtraBytesProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putObjectProperty, putObjectProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putStringProperty, receiveBuffer, rejectConsumer, reloadExpiration, removeAnnotation, removeExtraBytesProperty, removeMessageAnnotation, removeProperty, removeProperty, resetMessageData, scanForMessageSection, scanForMessageSection, scanMessageData, scanMessageData, sendBuffer, setAddress, setAddress, setAnnotation, setBrokerProperty, setConnectionID, setCorrelationID, setDeliveryAnnotationsForSendBuffer, setDurable, setExpiration, setExtraProperties, setIngressTimestamp, setLastValueProperty, setMessageAnnotation, setMessageAnnotation, setMessageAnnotations, setMessageID, setOwner, setPriority, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setUserID, toCompositeData, toCore, toDebugString, toPropertyMap, toString, unmarshalledApplicationPropertiesMemoryEstimateFromData, writeDeliveryAnnotationsForSendBuffer
-
Methods inherited from class org.apache.activemq.artemis.api.core.RefCountMessage
debugRefs, debugString, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, getUserContext, refDown, refUp, setParentRef, setUserContext, usageDown, usageUp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.LargeServerMessage
addBytes, getMessageID
-
Methods inherited from interface org.apache.activemq.artemis.api.core.Message
durableDown, durableUp, getAnnotationString, getBodyBuffer, getBodyInputStream, getDuplicateIDBytes, getDurableCount, getRefCount, getStringBody, getType, getUsage, getUserContext, getValidatedUserID, isExpired, refDown, refUp, setGroupID, setGroupID, setGroupSequence, setType, setUserContext, setValidatedUserID, toMap, toMap, toPropertyMap, usageDown, usageUp
-
-
-
-
Constructor Detail
-
AMQPLargeMessage
public AMQPLargeMessage(long id, long messageFormat, org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools, org.apache.activemq.artemis.core.persistence.StorageManager storageManager)
-
AMQPLargeMessage
public AMQPLargeMessage(long id, long messageFormat, org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools, org.apache.activemq.artemis.core.persistence.StorageManager storageManager, org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody largeBody)
-
-
Method Detail
-
toCore
public org.apache.activemq.artemis.api.core.ICoreMessage toCore(org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)
- Specified by:
toCorein interfaceorg.apache.activemq.artemis.api.core.Message- Overrides:
toCorein classAMQPMessage
-
releaseEncodedBuffer
public void releaseEncodedBuffer()
-
releaseEncodedBufferAfterWrite
public void releaseEncodedBufferAfterWrite()
getSavedEncodeBuffer()will retain two counters from the buffer, one meant for the call, and one that must be released only after encoding. This method is meant to be called when the buffer is actually encoded on the journal, meaning both refs are gone. and the actual buffer can be released.
-
checkReference
public void checkReference(org.apache.activemq.artemis.core.server.MessageReference reference)
This method check the reference for specifics on protocolData. It was written to check the deliveryAnnotationsForSendBuffer and eventually move it to the protocolData.
-
getPositionAfterDeliveryAnnotations
public int getPositionAfterDeliveryAnnotations()
during large message deliver, we need this calculation to place a new delivery annotation
-
inspectTemporaryBuffer
public io.netty.buffer.ByteBuf inspectTemporaryBuffer()
This is used on test assertions to make sure the buffers are released corrected
-
getSavedEncodeBuffer
public io.netty.buffer.ByteBuf getSavedEncodeBuffer()
-
readSavedEncoding
protected void readSavedEncoding(io.netty.buffer.ByteBuf buf)
-
validateFile
public void validateFile() throws org.apache.activemq.artemis.api.core.ActiveMQException- Specified by:
validateFilein interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage- Throws:
org.apache.activemq.artemis.api.core.ActiveMQException
-
setFileDurable
public void setFileDurable(boolean value)
-
getStorageManager
public org.apache.activemq.artemis.core.persistence.StorageManager getStorageManager()
- Specified by:
getStorageManagerin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage
-
setStorageManager
public void setStorageManager(org.apache.activemq.artemis.core.persistence.StorageManager storageManager)
- Specified by:
setStorageManagerin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage
-
isDurable
public final boolean isDurable()
- Specified by:
isDurablein interfaceorg.apache.activemq.artemis.api.core.Message- Overrides:
isDurablein classAMQPMessage
-
getData
public org.apache.qpid.proton.codec.ReadableBuffer getData()
- Specified by:
getDatain classAMQPMessage
-
parseHeader
public void parseHeader(org.apache.qpid.proton.codec.ReadableBuffer buffer)
-
addBytes
public void addBytes(org.apache.qpid.proton.codec.ReadableBuffer data) throws java.lang.Exception- Throws:
java.lang.Exception
-
parseLargeMessage
protected void parseLargeMessage(org.apache.activemq.artemis.api.core.ActiveMQBuffer data, boolean initialHeader)
-
parseLargeMessage
protected void parseLargeMessage(byte[] data, boolean initialHeader)
-
parseLargeMessage
protected void parseLargeMessage(org.apache.qpid.proton.codec.ReadableBuffer data)
-
toMessage
public org.apache.activemq.artemis.api.core.Message toMessage()
- Specified by:
toMessagein interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage
-
addBytes
public void addBytes(byte[] bytes) throws java.lang.Exception- Specified by:
addBytesin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage- Specified by:
addBytesin interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage- Throws:
java.lang.Exception
-
addBytes
public void addBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer bytes, boolean initialHeader) throws java.lang.Exception- Specified by:
addBytesin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage- Throws:
java.lang.Exception
-
setPaged
public void setPaged()
- Specified by:
setPagedin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage
-
releaseResources
public void releaseResources(boolean sync, boolean sendEvent)- Specified by:
releaseResourcesin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage- Specified by:
releaseResourcesin interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
-
deleteFile
public void deleteFile() throws java.lang.Exception- Specified by:
deleteFilein interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage- Specified by:
deleteFilein interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage- Throws:
java.lang.Exception
-
getAppendFile
public org.apache.activemq.artemis.core.io.SequentialFile getAppendFile() throws org.apache.activemq.artemis.api.core.ActiveMQException- Specified by:
getAppendFilein interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage- Throws:
org.apache.activemq.artemis.api.core.ActiveMQException
-
isLargeMessage
public boolean isLargeMessage()
- Specified by:
isLargeMessagein interfaceorg.apache.activemq.artemis.api.core.Message
-
getLargeBodyReader
public org.apache.activemq.artemis.core.message.LargeBodyReader getLargeBodyReader()
- Specified by:
getLargeBodyReaderin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage
-
getLargeBody
public org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody getLargeBody()
- Specified by:
getLargeBodyin interfaceorg.apache.activemq.artemis.core.server.LargeServerMessage
-
clearPendingRecordID
public void clearPendingRecordID()
- Specified by:
clearPendingRecordIDin interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
-
hasPendingRecord
public boolean hasPendingRecord()
- Specified by:
hasPendingRecordin interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
-
setPendingRecordID
public void setPendingRecordID(long pendingRecordID)
- Specified by:
setPendingRecordIDin interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
-
getPendingRecordID
public long getPendingRecordID()
- Specified by:
getPendingRecordIDin interfaceorg.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
-
releaseComplete
protected void releaseComplete()
- Overrides:
releaseCompletein classorg.apache.activemq.artemis.api.core.RefCountMessage
-
copy
public org.apache.activemq.artemis.api.core.Message copy()
- Specified by:
copyin interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
copyin classAMQPMessage
-
copy
public org.apache.activemq.artemis.api.core.Message copy(long newID)
- Specified by:
copyin interfaceorg.apache.activemq.artemis.api.core.Message
-
copy
public org.apache.activemq.artemis.api.core.Message copy(long newID, boolean isDLQOrExpiry)- Specified by:
copyin interfaceorg.apache.activemq.artemis.api.core.Message
-
newHeaderWithoutExpiry
protected io.netty.buffer.ByteBuf newHeaderWithoutExpiry(java.util.concurrent.atomic.AtomicInteger placeOutput)
-
messageChanged
public void messageChanged()
- Specified by:
messageChangedin interfaceorg.apache.activemq.artemis.api.core.Message- Overrides:
messageChangedin classAMQPMessage
-
getEncodeSize
public int getEncodeSize()
- Specified by:
getEncodeSizein interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
getEncodeSizein classAMQPMessage
-
getWholeMessageSize
public long getWholeMessageSize()
- Specified by:
getWholeMessageSizein interfaceorg.apache.activemq.artemis.api.core.Message
-
getMemoryEstimate
public int getMemoryEstimate()
- Specified by:
getMemoryEstimatein interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
getMemoryEstimatein classAMQPMessage
-
persist
public void persist(org.apache.activemq.artemis.api.core.ActiveMQBuffer targetRecord)
- Specified by:
persistin interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
persistin classAMQPMessage
-
getPersistSize
public int getPersistSize()
- Specified by:
getPersistSizein interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
getPersistSizein classAMQPMessage
-
reloadPersistence
public void reloadPersistence(org.apache.activemq.artemis.api.core.ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)- Specified by:
reloadPersistencein interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
reloadPersistencein classAMQPMessage
-
getPersistentSize
public long getPersistentSize()
- Specified by:
getPersistentSizein interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
getPersistentSizein classAMQPMessage
-
getPersister
public org.apache.activemq.artemis.core.persistence.Persister<org.apache.activemq.artemis.api.core.Message> getPersister()
- Specified by:
getPersisterin interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
getPersisterin classAMQPMessage
-
reencode
public void reencode()
- Specified by:
reencodein interfaceorg.apache.activemq.artemis.api.core.Message- Specified by:
reencodein classAMQPMessage
-
setReencoded
public void setReencoded(boolean reencoded)
-
isReencoded
public boolean isReencoded()
-
ensureDataIsValid
protected void ensureDataIsValid()
- Specified by:
ensureDataIsValidin classAMQPMessage
-
encodeMessage
protected void encodeMessage()
- Specified by:
encodeMessagein classAMQPMessage
-
referenceOriginalMessage
public void referenceOriginalMessage(org.apache.activemq.artemis.api.core.Message original, org.apache.activemq.artemis.api.core.SimpleString originalQueue)- Specified by:
referenceOriginalMessagein interfaceorg.apache.activemq.artemis.api.core.Message
-
-