Class LargeServerMessageImpl
java.lang.Object
org.apache.activemq.artemis.api.core.RefCountMessage
org.apache.activemq.artemis.core.message.impl.CoreMessage
org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageImpl
- All Implemented Interfaces:
ICoreMessage,Message,ReplicatedLargeMessage,CoreLargeServerMessage,LargeServerMessage
-
Field Summary
Fields inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
address, BODY_OFFSET, buffer, BUFFER_HEADER_SPACE, durable, endOfBodyPosition, memoryEstimate, messageID, messageIDPosition, paged, priority, properties, timestamp, type, writableBufferFields inherited from interface org.apache.activemq.artemis.api.core.Message
AMQP_PROPERTY_PREDICATE, 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, PREFIX_AMQP_ANNOTATIONS, STREAM_TYPE, TEXT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionLargeServerMessageImpl(byte type, long id, StorageManager storageManager, SequentialFile fileCopy) LargeServerMessageImpl(LargeServerMessageImpl copy, TypedProperties properties, SequentialFile fileCopy, long newID) Copy constructorLargeServerMessageImpl(StorageManager storageManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBytes(byte[] bytes) voidaddBytes(ActiveMQBuffer bytes, boolean initialHeader) static MessagecheckLargeMessage(Message message, StorageManager storageManager) This will check if a regular message needs to be converted as large messagecopy()It will generate a new instance of the message encode, being a deep copy, new properties, new everythingcopy(long newID) It will generate a new instance of the message encode, being a deep copy, new properties, new everythingvoiddecode(ActiveMQBuffer buffer1) voidvoidencode(ActiveMQBuffer buffer1) This will return the File suitable for appending the messageintReturns the length in bytes of the body buffer.longintReturns the size of the encoded message.intlongThis is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body sizeReturns a new Buffer slicing the current Body.longReturn an estimate of the size of the message on the wire. for LargeMessages this will contain whatever is needed to encode properties and the body size of large messages.booleanbooleanisOpen()booleanWe are really interested if this is a LargeServerMessage.voidreferenceOriginalMessage(Message original, SimpleString originalQueue) protected voidvoidreleaseResources(boolean sync, boolean sendEvent) Close the files if openedsetMessageID(long messageID) voidsetPaged()voidsetStorageManager(StorageManager storageManager) toString()Methods inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
checkEncode, clearAMQPProperties, clearInternalProperties, containsProperty, containsProperty, decodeHeadersAndProperties, encode, encodeHeadersAndProperties, getAddress, getAddressSimpleString, getAnnotation, getBodyBuffer, getBodyInputStream, getBooleanProperty, getBooleanProperty, getBuffer, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getCorrelationID, getDataBuffer, getDoubleProperty, getDoubleProperty, getDuplicateProperty, getEndOfBodyPosition, getExpiration, getFloatProperty, getFloatProperty, getGroupID, getGroupSequence, getHeadersAndPropertiesEncodeSize, getIntProperty, getIntProperty, getLastValueProperty, getLongProperty, getLongProperty, getMessageID, getObjectProperty, getObjectProperty, getOwner, getPersister, getPersistSize, getPriority, getProperties, getPropertyNames, getProtocolName, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringBody, getStringProperty, getStringProperty, getTimestamp, getType, getUserID, getValidatedUserID, hasScheduledDeliveryTime, initBuffer, internalSetMessageID, isDurable, isPaged, messageChanged, moveHeadersAndProperties, persist, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putCharProperty, putCharProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putObjectProperty, putObjectProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putStringProperty, receiveBuffer, receiveBuffer_1X, reloadPersistence, removeAnnotation, removeProperty, removeProperty, searchProperty, sendBuffer, sendBuffer_1X, setAddress, setAddress, setBuffer, setCorrelationID, setDurable, setExpiration, setGroupID, setGroupID, setGroupSequence, setLastValueProperty, setOwner, setPriority, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setType, setUserID, setUserID, setValidatedUserID, toCompositeData, toCore, toCoreMethods inherited from class org.apache.activemq.artemis.api.core.RefCountMessage
counterString, debugLocations, deferredDebug, deferredDebug, deferredDebug, disableErrorCheck, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, getUserContext, isRefDebugEnabled, isRefTraceEnabled, isReleased, onDown, onUp, refDown, refUp, registerDebug, released, setParentRef, setUserContext, usageDown, usageUpMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.api.core.ICoreMessage
isConfirmed, setConfirmed, toMapMethods inherited from interface org.apache.activemq.artemis.core.server.LargeServerMessage
addBytes, getMessageIDMethods inherited from interface org.apache.activemq.artemis.api.core.Message
acceptsConsumer, copy, durableDown, durableUp, getAnnotationString, getBrokerProperty, getConnectionID, getDuplicateIDBytes, getDurableCount, getExtraBytesProperty, getIngressTimestamp, getObjectPropertyForFilter, getOriginalEstimate, getRefCount, getUsage, getUserContext, isExpired, putExtraBytesProperty, reencode, refDown, refUp, rejectConsumer, removeExtraBytesProperty, routed, setAnnotation, setBrokerProperty, setConnectionID, setIngressTimestamp, setUserContext, toMap, toPropertyMap, toPropertyMap, usageDown, usageUpMethods inherited from interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
setDurable
-
Constructor Details
-
LargeServerMessageImpl
-
LargeServerMessageImpl
public LargeServerMessageImpl(LargeServerMessageImpl copy, TypedProperties properties, SequentialFile fileCopy, long newID) Copy constructor -
LargeServerMessageImpl
public LargeServerMessageImpl(byte type, long id, StorageManager storageManager, SequentialFile fileCopy)
-
-
Method Details
-
toMessage
- Specified by:
toMessagein interfaceLargeServerMessage
-
checkLargeMessage
public static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception This will check if a regular message needs to be converted as large message- Throws:
Exception
-
getBodySize
- Throws:
ActiveMQException
-
setMessageID
- Specified by:
setMessageIDin interfaceMessage- Specified by:
setMessageIDin interfaceReplicatedLargeMessage- Overrides:
setMessageIDin classCoreMessage- See Also:
-
getMessage
- Specified by:
getMessagein interfaceReplicatedLargeMessage
-
getStorageManager
- Specified by:
getStorageManagerin interfaceLargeServerMessage
-
isServerMessage
public boolean isServerMessage()Description copied from interface:ICoreMessageWe are really interested if this is a LargeServerMessage.- Specified by:
isServerMessagein interfaceICoreMessage- Overrides:
isServerMessagein classCoreMessage
-
setPaged
public void setPaged()- Specified by:
setPagedin interfaceLargeServerMessage- Specified by:
setPagedin interfaceMessage- Overrides:
setPagedin classCoreMessage
-
addBytes
- Specified by:
addBytesin interfaceLargeServerMessage- Specified by:
addBytesin interfaceReplicatedLargeMessage- Throws:
Exception- See Also:
-
addBytes
- Specified by:
addBytesin interfaceLargeServerMessage- Throws:
Exception
-
getEncodeSize
public int getEncodeSize()Description copied from interface:MessageReturns the size of the encoded message.- Specified by:
getEncodeSizein interfaceMessage- Overrides:
getEncodeSizein classCoreMessage- Returns:
- the size of the encoded message
-
getWholeMessageSize
public long getWholeMessageSize()Description copied from interface:MessageReturn an estimate of the size of the message on the wire. for LargeMessages this will contain whatever is needed to encode properties and the body size of large messages. For AMQP this will return the whole body size of the message as the body will contain all the data including properties.- Specified by:
getWholeMessageSizein interfaceMessage
-
encode
-
decode
-
getLargeBodyReader
- Specified by:
getLargeBodyReaderin interfaceICoreMessage- Specified by:
getLargeBodyReaderin interfaceLargeServerMessage- Overrides:
getLargeBodyReaderin classCoreMessage
-
releaseComplete
protected void releaseComplete()- Overrides:
releaseCompletein classRefCountMessage
-
getReadOnlyBodyBuffer
Description copied from interface:ICoreMessageReturns a new Buffer slicing the current Body.- Specified by:
getReadOnlyBodyBufferin interfaceICoreMessage- Overrides:
getReadOnlyBodyBufferin classCoreMessage- Returns:
- a new Buffer slicing the current Body
-
getBodyBufferSize
public int getBodyBufferSize()Description copied from interface:ICoreMessageReturns the length in bytes of the body buffer.- Specified by:
getBodyBufferSizein interfaceICoreMessage- Overrides:
getBodyBufferSizein classCoreMessage- Returns:
- the length in bytes of the body buffer
-
isLargeMessage
public boolean isLargeMessage()- Specified by:
isLargeMessagein interfaceMessage- Overrides:
isLargeMessagein classCoreMessage
-
deleteFile
- Specified by:
deleteFilein interfaceLargeServerMessage- Specified by:
deleteFilein interfaceReplicatedLargeMessage- Throws:
Exception- See Also:
-
getMemoryEstimate
public int getMemoryEstimate()- Specified by:
getMemoryEstimatein interfaceMessage- Overrides:
getMemoryEstimatein classCoreMessage
-
releaseResources
public void releaseResources(boolean sync, boolean sendEvent) Description copied from interface:LargeServerMessageClose the files if opened- Specified by:
releaseResourcesin interfaceLargeServerMessage- Specified by:
releaseResourcesin interfaceReplicatedLargeMessage- See Also:
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceLargeServerMessage
-
referenceOriginalMessage
- Specified by:
referenceOriginalMessagein interfaceMessage
-
setStorageManager
- Specified by:
setStorageManagerin interfaceLargeServerMessage
-
copy
Description copied from interface:MessageIt will generate a new instance of the message encode, being a deep copy, new properties, new everything- Specified by:
copyin interfaceMessage- Overrides:
copyin classCoreMessage
-
getLargeBody
- Specified by:
getLargeBodyin interfaceLargeServerMessage
-
copy
Description copied from interface:MessageIt will generate a new instance of the message encode, being a deep copy, new properties, new everything- Specified by:
copyin interfaceMessage- Overrides:
copyin classCoreMessage
-
getAppendFile
Description copied from interface:LargeServerMessageThis will return the File suitable for appending the message- Specified by:
getAppendFilein interfaceLargeServerMessage- Throws:
ActiveMQException
-
getPersistentSize
Description copied from interface:MessageThis is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body size- Specified by:
getPersistentSizein interfaceMessage- Overrides:
getPersistentSizein classCoreMessage- Throws:
ActiveMQException
-
toString
- Overrides:
toStringin classCoreMessage
-