Class 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
    • 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:
        toCore in interface org.apache.activemq.artemis.api.core.Message
        Overrides:
        toCore in class AMQPMessage
      • 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:
        validateFile in interface org.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:
        getStorageManager in interface org.apache.activemq.artemis.core.server.LargeServerMessage
      • setStorageManager

        public void setStorageManager​(org.apache.activemq.artemis.core.persistence.StorageManager storageManager)
        Specified by:
        setStorageManager in interface org.apache.activemq.artemis.core.server.LargeServerMessage
      • isDurable

        public final boolean isDurable()
        Specified by:
        isDurable in interface org.apache.activemq.artemis.api.core.Message
        Overrides:
        isDurable in class AMQPMessage
      • getData

        public org.apache.qpid.proton.codec.ReadableBuffer getData()
        Specified by:
        getData in class AMQPMessage
      • 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:
        toMessage in interface org.apache.activemq.artemis.core.server.LargeServerMessage
      • addBytes

        public void addBytes​(byte[] bytes)
                      throws java.lang.Exception
        Specified by:
        addBytes in interface org.apache.activemq.artemis.core.server.LargeServerMessage
        Specified by:
        addBytes in interface org.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:
        addBytes in interface org.apache.activemq.artemis.core.server.LargeServerMessage
        Throws:
        java.lang.Exception
      • setPaged

        public void setPaged()
        Specified by:
        setPaged in interface org.apache.activemq.artemis.core.server.LargeServerMessage
      • releaseResources

        public void releaseResources​(boolean sync,
                                     boolean sendEvent)
        Specified by:
        releaseResources in interface org.apache.activemq.artemis.core.server.LargeServerMessage
        Specified by:
        releaseResources in interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
      • deleteFile

        public void deleteFile()
                        throws java.lang.Exception
        Specified by:
        deleteFile in interface org.apache.activemq.artemis.core.server.LargeServerMessage
        Specified by:
        deleteFile in interface org.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:
        getAppendFile in interface org.apache.activemq.artemis.core.server.LargeServerMessage
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • isLargeMessage

        public boolean isLargeMessage()
        Specified by:
        isLargeMessage in interface org.apache.activemq.artemis.api.core.Message
      • getLargeBodyReader

        public org.apache.activemq.artemis.core.message.LargeBodyReader getLargeBodyReader()
        Specified by:
        getLargeBodyReader in interface org.apache.activemq.artemis.core.server.LargeServerMessage
      • getLargeBody

        public org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody getLargeBody()
        Specified by:
        getLargeBody in interface org.apache.activemq.artemis.core.server.LargeServerMessage
      • clearPendingRecordID

        public void clearPendingRecordID()
        Specified by:
        clearPendingRecordID in interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
      • hasPendingRecord

        public boolean hasPendingRecord()
        Specified by:
        hasPendingRecord in interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
      • setPendingRecordID

        public void setPendingRecordID​(long pendingRecordID)
        Specified by:
        setPendingRecordID in interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
      • getPendingRecordID

        public long getPendingRecordID()
        Specified by:
        getPendingRecordID in interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
      • releaseComplete

        protected void releaseComplete()
        Overrides:
        releaseComplete in class org.apache.activemq.artemis.api.core.RefCountMessage
      • copy

        public org.apache.activemq.artemis.api.core.Message copy()
        Specified by:
        copy in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        copy in class AMQPMessage
      • copy

        public org.apache.activemq.artemis.api.core.Message copy​(long newID)
        Specified by:
        copy in interface org.apache.activemq.artemis.api.core.Message
      • copy

        public org.apache.activemq.artemis.api.core.Message copy​(long newID,
                                                                 boolean isDLQOrExpiry)
        Specified by:
        copy in interface org.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:
        messageChanged in interface org.apache.activemq.artemis.api.core.Message
        Overrides:
        messageChanged in class AMQPMessage
      • getEncodeSize

        public int getEncodeSize()
        Specified by:
        getEncodeSize in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        getEncodeSize in class AMQPMessage
      • getWholeMessageSize

        public long getWholeMessageSize()
        Specified by:
        getWholeMessageSize in interface org.apache.activemq.artemis.api.core.Message
      • getMemoryEstimate

        public int getMemoryEstimate()
        Specified by:
        getMemoryEstimate in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        getMemoryEstimate in class AMQPMessage
      • persist

        public void persist​(org.apache.activemq.artemis.api.core.ActiveMQBuffer targetRecord)
        Specified by:
        persist in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        persist in class AMQPMessage
      • getPersistSize

        public int getPersistSize()
        Specified by:
        getPersistSize in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        getPersistSize in class AMQPMessage
      • reloadPersistence

        public void reloadPersistence​(org.apache.activemq.artemis.api.core.ActiveMQBuffer record,
                                      org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)
        Specified by:
        reloadPersistence in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        reloadPersistence in class AMQPMessage
      • getPersistentSize

        public long getPersistentSize()
        Specified by:
        getPersistentSize in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        getPersistentSize in class AMQPMessage
      • getPersister

        public org.apache.activemq.artemis.core.persistence.Persister<org.apache.activemq.artemis.api.core.Message> getPersister()
        Specified by:
        getPersister in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        getPersister in class AMQPMessage
      • reencode

        public void reencode()
        Specified by:
        reencode in interface org.apache.activemq.artemis.api.core.Message
        Specified by:
        reencode in class AMQPMessage
      • setReencoded

        public void setReencoded​(boolean reencoded)
      • isReencoded

        public boolean isReencoded()
      • referenceOriginalMessage

        public void referenceOriginalMessage​(org.apache.activemq.artemis.api.core.Message original,
                                             org.apache.activemq.artemis.api.core.SimpleString originalQueue)
        Specified by:
        referenceOriginalMessage in interface org.apache.activemq.artemis.api.core.Message