Class AMQPMessage
- java.lang.Object
-
- org.apache.activemq.artemis.api.core.RefCountMessage
-
- org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage
-
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
AMQPLargeMessage,AMQPStandardMessage
public abstract class AMQPMessage extends RefCountMessage implements Message
See AMQP v1.0 message formatBare Message | .---------------------+--------------------. | | +--------+-------------+-------------+------------+--------------+--------------+--------+ | header | delivery- | message- | properties | application- | application- | footer | | | annotations | annotations | | properties | data | | +--------+-------------+-------------+------------+--------------+--------------+--------+ | | '-------------------------------------------+--------------------------------------------' | Annotated Message- Zero or one header sections.
- Zero or one delivery-annotation sections.
- Zero or one message-annotation sections.
- Zero or one properties sections.
- Zero or one application-properties sections.
- The body consists of one of the following three choices:
- one or more data sections
- one or more amqp-sequence sections
- or a single amqp-value section.
- Zero or one footer sections.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAMQPMessage.MessageDataScanningStatusThis has been made public just for testing purposes: it's not stable and developers shouldn't rely on this for developing purposes.
-
Field Summary
Fields Modifier and Type Field Description protected SimpleStringaddressstatic SimpleStringADDRESS_PROPERTYprotected org.apache.qpid.proton.amqp.messaging.ApplicationPropertiesapplicationPropertiesprotected intapplicationPropertiesPositionprotected StringconnectionIDprotected org.apache.activemq.artemis.core.persistence.CoreMessageObjectPoolscoreMessageObjectPoolsstatic intDEFAULT_MESSAGE_FORMATstatic intDEFAULT_MESSAGE_PRIORITYprotected org.apache.qpid.proton.amqp.messaging.DeliveryAnnotationsdeliveryAnnotationsprotected org.apache.qpid.proton.amqp.messaging.DeliveryAnnotationsdeliveryAnnotationsForSendBufferprotected intdeliveryAnnotationsPositionprotected intencodedDeliveryAnnotationsSizeprotected intencodedHeaderSizeprotected longexpirationprotected booleanexpirationReloadprotected org.apache.activemq.artemis.utils.collections.TypedPropertiesextraPropertiesprotected org.apache.qpid.proton.amqp.messaging.Headerheaderprotected intheaderPositionprotected booleanisPagedprotected static org.slf4j.Loggerloggerstatic intMAX_MESSAGE_PRIORITYprotected intmemoryEstimateprotected org.apache.qpid.proton.amqp.messaging.MessageAnnotationsmessageAnnotationsprotected intmessageAnnotationsPositionprotected bytemessageDataScannedprotected longmessageFormatprotected longmessageIDprotected booleanmodifiedprotected org.apache.qpid.proton.amqp.messaging.Propertiespropertiesprotected intpropertiesPositionprotected Set<Object>rejectedConsumersprotected intremainingBodyPositionprotected longscheduledTimeprotected static intVALUE_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 Modifier Constructor Description protectedAMQPMessage(long messageFormat)AMQPMessage(long messageFormat, org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)Creates a newAMQPMessageinstance from binary encoded message data.protectedAMQPMessage(AMQPMessage copy)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanacceptsConsumer(long consumer)protected static voidaddAnnotationsAsProperties(String prefix, Map map, org.apache.qpid.proton.amqp.messaging.MessageAnnotations annotations)protected SimpleStringcachedAddressSimpleString(String address)voidclearInternalProperties()booleancontainsProperty(String key)booleancontainsProperty(SimpleString key)abstract Messagecopy()protected org.apache.qpid.proton.codec.ReadableBuffercreateDeliveryCopy(int deliveryCount, org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations)it will create a copy with the relevant delivery annotation and its copyorg.apache.activemq.artemis.utils.collections.TypedPropertiescreateExtraProperties()protected abstract voidencodeMessage()protected abstract voidensureDataIsValid()protected voidensureMessageDataScanned()protected voidensureScanning()StringgetAddress()SimpleStringgetAddressSimpleString()ObjectgetAMQPUserID()Before we added AMQP into Artemis the name getUserID was already taken by JMSMessageID.ObjectgetAnnotation(SimpleString key)org.apache.qpid.proton.amqp.messaging.ApplicationPropertiesgetApplicationProperties()Returns a copy of theApplicationPropertiespresent in the message if present or null.protected Map<String,Object>getApplicationPropertiesMap(boolean createIfAbsent)org.apache.qpid.proton.amqp.messaging.SectiongetBody()Retrieves the AMQP Section that composes the body of this message by decoding a fresh copy from the encoded message data.BooleangetBooleanProperty(String key)BooleangetBooleanProperty(SimpleString key)ObjectgetBrokerProperty(SimpleString key)BytegetByteProperty(String key)BytegetByteProperty(SimpleString key)byte[]getBytesProperty(String key)byte[]getBytesProperty(SimpleString key)StringgetConnectionID()ObjectgetCorrelationID()protected abstract org.apache.qpid.proton.codec.ReadableBuffergetData()AMQPMessage.MessageDataScanningStatusgetDataScanningStatus()protected org.apache.qpid.proton.amqp.messaging.ApplicationPropertiesgetDecodedApplicationProperties()This will return application properties without attempting to decode it.protected org.apache.qpid.proton.amqp.messaging.MessageAnnotationsgetDecodedMessageAnnotations()org.apache.qpid.proton.amqp.messaging.DeliveryAnnotationsgetDeliveryAnnotations()Returns a copy of the MessageAnnotations in the message if present or null.protected intgetDeliveryAnnotationsForSendBufferSize()DoublegetDoubleProperty(String key)DoublegetDoubleProperty(SimpleString key)ObjectgetDuplicateProperty()abstract intgetEncodeSize()protected intgetEstimateSavedEncode()longgetExpiration()byte[]getExtraBytesProperty(SimpleString key)org.apache.activemq.artemis.utils.collections.TypedPropertiesgetExtraProperties()FloatgetFloatProperty(String key)FloatgetFloatProperty(SimpleString key)org.apache.qpid.proton.amqp.messaging.FootergetFooter()Retrieves the AMQP Footer encoded in the data of this message by decoding a fresh copy from the encoded message data.SimpleStringgetGroupID()intgetGroupSequence()org.apache.qpid.proton.amqp.messaging.HeadergetHeader()Returns a copy of the message Header if one is present, changes to the returned Header instance do not affect the original Message.LonggetIngressTimestamp()IntegergetIntProperty(String key)IntegergetIntProperty(SimpleString key)SimpleStringgetLastValueProperty()LonggetLongProperty(String key)LonggetLongProperty(SimpleString key)abstract intgetMemoryEstimate()protected ObjectgetMessageAnnotation(String annotation)protected ObjectgetMessageAnnotation(org.apache.qpid.proton.amqp.Symbol annotation)org.apache.qpid.proton.amqp.messaging.MessageAnnotationsgetMessageAnnotations()Returns a copy of the DeliveryAnnotations in the message if present or null.protected Map<org.apache.qpid.proton.amqp.Symbol,Object>getMessageAnnotationsMap(boolean createIfAbsent)longgetMessageFormat()longgetMessageID()ObjectgetObjectProperty(String key)ObjectgetObjectProperty(SimpleString key)ObjectgetObjectPropertyForFilter(SimpleString key)ObjectgetOwner()abstract longgetPersistentSize()abstract org.apache.activemq.artemis.core.persistence.Persister<Message>getPersister()abstract intgetPersistSize()bytegetPriority()org.apache.qpid.proton.amqp.messaging.PropertiesgetProperties()Returns a copy of the message Properties if one is present, changes to the returned Properties instance do not affect the original Message.protected SimpleString.StringSimpleStringPoolgetPropertyKeysPool()Set<SimpleString>getPropertyNames()protected SimpleString.StringSimpleStringPoolgetPropertyValuesPool()StringgetProtocolName()org.apache.qpid.proton.message.impl.MessageImplgetProtonMessage()Creates and returns a Proton-J MessageImpl wrapper around the message data.SimpleStringgetReplyTo()RoutingTypegetRoutingType()LonggetScheduledDeliveryTime()org.apache.qpid.proton.codec.ReadableBuffergetSendBuffer(int deliveryCount, org.apache.activemq.artemis.core.server.MessageReference reference)Gets a ByteBuf from the Message that contains the encoded bytes to be sent on the wire.ShortgetShortProperty(String key)ShortgetShortProperty(SimpleString key)SimpleStringgetSimpleStringProperty(String key)SimpleStringgetSimpleStringProperty(SimpleString key)StringgetStringProperty(String key)StringgetStringProperty(SimpleString key)longgetTimestamp()ObjectgetUserID()booleanhasScheduledDeliveryTime()protected intinternalPersistSize()booleanisDurable()booleanisPaged()protected org.apache.qpid.proton.amqp.messaging.ApplicationPropertieslazyDecodeApplicationProperties()protected org.apache.qpid.proton.amqp.messaging.ApplicationPropertieslazyDecodeApplicationProperties(org.apache.qpid.proton.codec.ReadableBuffer data)protected voidlazyScanAfterReloadPersistence()voidmessageChanged()abstract voidpersist(ActiveMQBuffer targetRecord)MessageputBooleanProperty(String key, boolean value)MessageputBooleanProperty(SimpleString key, boolean value)MessageputByteProperty(String key, byte value)MessageputByteProperty(SimpleString key, byte value)MessageputBytesProperty(String key, byte[] value)MessageputBytesProperty(SimpleString key, byte[] value)MessageputCharProperty(String key, char value)MessageputCharProperty(SimpleString key, char value)MessageputDoubleProperty(String key, double value)MessageputDoubleProperty(SimpleString key, double value)MessageputExtraBytesProperty(SimpleString key, byte[] value)MessageputFloatProperty(String key, float value)MessageputFloatProperty(SimpleString key, float value)MessageputIntProperty(String key, int value)MessageputIntProperty(SimpleString key, int value)MessageputLongProperty(String key, long value)MessageputLongProperty(SimpleString key, long value)MessageputObjectProperty(String key, Object value)MessageputObjectProperty(SimpleString key, Object value)MessageputShortProperty(String key, short value)MessageputShortProperty(SimpleString key, short value)MessageputStringProperty(String key, String value)MessageputStringProperty(SimpleString key, String value)MessageputStringProperty(SimpleString key, SimpleString value)voidreceiveBuffer(io.netty.buffer.ByteBuf buffer)abstract voidreencode()voidrejectConsumer(long consumer)voidreloadExpiration(long expiration)abstract voidreloadPersistence(ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)ObjectremoveAnnotation(SimpleString key)byte[]removeExtraBytesProperty(SimpleString key)protected ObjectremoveMessageAnnotation(org.apache.qpid.proton.amqp.Symbol annotation)ObjectremoveProperty(String key)ObjectremoveProperty(SimpleString key)protected voidresetMessageData()protected <T> TscanForMessageSection(int scanStartPosition, Class... targetTypes)protected <T> TscanForMessageSection(org.apache.qpid.proton.codec.ReadableBuffer buffer, int scanStartPosition, Class... targetTypes)protected voidscanMessageData()protected voidscanMessageData(org.apache.qpid.proton.codec.ReadableBuffer data)voidsendBuffer(io.netty.buffer.ByteBuf buffer, int deliveryCount)Would be called by the Artemis Core components to encode the message into the provided send buffer.AMQPMessagesetAddress(String address)AMQPMessagesetAddress(SimpleString address)AMQPMessagesetAnnotation(SimpleString key, Object value)MessagesetBrokerProperty(SimpleString key, Object value)MessagesetConnectionID(String connectionID)MessagesetCorrelationID(Object correlationID)voidsetDeliveryAnnotationsForSendBuffer(org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations)Deprecated.use MessageReference.setProtocolData(deliveryAnnotations)MessagesetDurable(boolean durable)AMQPMessagesetExpiration(long expiration)AMQPMessagesetExtraProperties(org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties)MessagesetIngressTimestamp()MessagesetLastValueProperty(SimpleString lastValueName)protected voidsetMessageAnnotation(String annotation, Object value)protected voidsetMessageAnnotation(org.apache.qpid.proton.amqp.Symbol annotation, Object value)protected voidsetMessageAnnotations(org.apache.qpid.proton.amqp.messaging.MessageAnnotations messageAnnotations)MessagesetMessageID(long id)voidsetOwner(Object object)voidsetPaged()MessagesetPriority(byte priority)AMQPMessagesetReplyTo(SimpleString address)MessagesetRoutingType(RoutingType routingType)AMQPMessagesetScheduledDeliveryTime(Long time)MessagesetTimestamp(long timestamp)MessagesetUserID(Object userID)CompositeDatatoCompositeData(int fieldsLimit, int deliveryCount)ICoreMessagetoCore()ICoreMessagetoCore(org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)StringtoDebugString()This is different from toString, as this will print an expanded version of the buffer in Hex and programmers's readable formatMap<String,Object>toPropertyMap(int valueSizeLimit)StringtoString()protected intunmarshalledApplicationPropertiesMemoryEstimateFromData(org.apache.qpid.proton.codec.ReadableBuffer data)protected voidwriteDeliveryAnnotationsForSendBuffer(io.netty.buffer.ByteBuf result, org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations)-
Methods 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, releaseComplete, released, 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.api.core.Message
copy, copy, durableDown, durableUp, getAnnotationString, getBodyBuffer, getBodyInputStream, getDuplicateIDBytes, getDurableCount, getRefCount, getStringBody, getType, getUsage, getUserContext, getValidatedUserID, getWholeMessageSize, isExpired, isLargeMessage, refDown, referenceOriginalMessage, refUp, setGroupID, setGroupID, setGroupSequence, setType, setUserContext, setValidatedUserID, toMap, toMap, toPropertyMap, usageDown, usageUp
-
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
ADDRESS_PROPERTY
public static final SimpleString ADDRESS_PROPERTY
-
DEFAULT_MESSAGE_FORMAT
public static final int DEFAULT_MESSAGE_FORMAT
- See Also:
- Constant Field Values
-
DEFAULT_MESSAGE_PRIORITY
public static final int DEFAULT_MESSAGE_PRIORITY
- See Also:
- Constant Field Values
-
MAX_MESSAGE_PRIORITY
public static final int MAX_MESSAGE_PRIORITY
- See Also:
- Constant Field Values
-
VALUE_NOT_PRESENT
protected static final int VALUE_NOT_PRESENT
- See Also:
- Constant Field Values
-
messageDataScanned
protected byte messageDataScanned
-
modified
protected boolean modified
-
headerPosition
protected int headerPosition
-
encodedHeaderSize
protected int encodedHeaderSize
-
deliveryAnnotationsPosition
protected int deliveryAnnotationsPosition
-
encodedDeliveryAnnotationsSize
protected int encodedDeliveryAnnotationsSize
-
messageAnnotationsPosition
protected int messageAnnotationsPosition
-
propertiesPosition
protected int propertiesPosition
-
applicationPropertiesPosition
protected int applicationPropertiesPosition
-
remainingBodyPosition
protected int remainingBodyPosition
-
messageFormat
protected final long messageFormat
-
messageID
protected long messageID
-
address
protected SimpleString address
-
memoryEstimate
protected volatile int memoryEstimate
-
expiration
protected long expiration
-
expirationReload
protected boolean expirationReload
-
scheduledTime
protected long scheduledTime
-
isPaged
protected boolean isPaged
-
header
protected org.apache.qpid.proton.amqp.messaging.Header header
-
messageAnnotations
protected org.apache.qpid.proton.amqp.messaging.MessageAnnotations messageAnnotations
-
properties
protected org.apache.qpid.proton.amqp.messaging.Properties properties
-
applicationProperties
protected org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties
-
connectionID
protected String connectionID
-
coreMessageObjectPools
protected final org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools
-
deliveryAnnotationsForSendBuffer
protected org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotationsForSendBuffer
-
deliveryAnnotations
protected org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations
-
extraProperties
protected volatile org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties
-
-
Constructor Detail
-
AMQPMessage
public AMQPMessage(long messageFormat, org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)Creates a newAMQPMessageinstance from binary encoded message data.- Parameters:
messageFormat- The Message format tag given the in Transfer that carried this messageextraProperties- Broker specific extra properties that should be carried with this message
-
AMQPMessage
protected AMQPMessage(AMQPMessage copy)
-
AMQPMessage
protected AMQPMessage(long messageFormat)
-
-
Method Detail
-
getProtocolName
public String getProtocolName()
- Specified by:
getProtocolNamein interfaceMessage
-
getDataScanningStatus
public final AMQPMessage.MessageDataScanningStatus getDataScanningStatus()
-
getDecodedApplicationProperties
protected org.apache.qpid.proton.amqp.messaging.ApplicationProperties getDecodedApplicationProperties()
This will return application properties without attempting to decode it. That means, if applicationProperties were never parsed before, this will return null, even if there is application properties. This was created as an internal method for testing, as we need to validate if the application properties are not decoded until needed.
-
getDecodedMessageAnnotations
protected org.apache.qpid.proton.amqp.messaging.MessageAnnotations getDecodedMessageAnnotations()
-
getData
protected abstract org.apache.qpid.proton.codec.ReadableBuffer getData()
-
getProtonMessage
public final org.apache.qpid.proton.message.impl.MessageImpl getProtonMessage()
Creates and returns a Proton-J MessageImpl wrapper around the message data. Changes to the returned Message are not reflected in this message.- Returns:
- a MessageImpl that wraps the AMQP message data in this
AMQPMessage
-
getObjectPropertyForFilter
public Object getObjectPropertyForFilter(SimpleString key)
- Specified by:
getObjectPropertyForFilterin interfaceMessage
-
getHeader
public final org.apache.qpid.proton.amqp.messaging.Header getHeader()
Returns a copy of the message Header if one is present, changes to the returned Header instance do not affect the original Message.- Returns:
- a copy of the Message Header if one exists or null if none present.
-
ensureScanning
protected void ensureScanning()
-
getDeliveryAnnotations
public final org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations getDeliveryAnnotations()
Returns a copy of the MessageAnnotations in the message if present or null. Changes to the returned DeliveryAnnotations instance do not affect the original Message.- Returns:
- a copy of the
DeliveryAnnotationspresent in the message or null if non present.
-
setDeliveryAnnotationsForSendBuffer
@Deprecated public final void setDeliveryAnnotationsForSendBuffer(org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations)
Deprecated.use MessageReference.setProtocolData(deliveryAnnotations)Sets the delivery annotations to be included when encoding the message for sending it on the wire. The broker can add additional message annotations as long as the annotations being added follow the rules from the spec. If the user adds something that the remote doesn't understand and it is not prefixed with "x-opt" the remote can just kill the link. See: http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-annotations- Parameters:
deliveryAnnotations- delivery annotations used in the sendBuffer() method
-
getMessageAnnotations
public final org.apache.qpid.proton.amqp.messaging.MessageAnnotations getMessageAnnotations()
Returns a copy of the DeliveryAnnotations in the message if present or null. Changes to the returned MessageAnnotations instance do not affect the original Message.- Returns:
- a copy of the
MessageAnnotationspresent in the message or null if non present.
-
getProperties
public final org.apache.qpid.proton.amqp.messaging.Properties getProperties()
Returns a copy of the message Properties if one is present, changes to the returned Properties instance do not affect the original Message.- Returns:
- a copy of the Message Properties if one exists or null if none present.
-
getApplicationProperties
public final org.apache.qpid.proton.amqp.messaging.ApplicationProperties getApplicationProperties()
Returns a copy of theApplicationPropertiespresent in the message if present or null. Changes to the returned MessageAnnotations instance do not affect the original Message.- Returns:
- a copy of the
ApplicationPropertiespresent in the message or null if non present.
-
toDebugString
public final String toDebugString()
This is different from toString, as this will print an expanded version of the buffer in Hex and programmers's readable format
-
getBody
public final org.apache.qpid.proton.amqp.messaging.Section getBody()
Retrieves the AMQP Section that composes the body of this message by decoding a fresh copy from the encoded message data. Changes to the returned value are not reflected in the value encoded in the original message.- Returns:
- the Section that makes up the body of this message.
-
getFooter
public final org.apache.qpid.proton.amqp.messaging.Footer getFooter()
Retrieves the AMQP Footer encoded in the data of this message by decoding a fresh copy from the encoded message data. Changes to the returned value are not reflected in the value encoded in the original message.- Returns:
- the Footer that was encoded into this AMQP Message.
-
scanForMessageSection
protected <T> T scanForMessageSection(int scanStartPosition, Class... targetTypes)
-
scanForMessageSection
protected <T> T scanForMessageSection(org.apache.qpid.proton.codec.ReadableBuffer buffer, int scanStartPosition, Class... targetTypes)
-
lazyDecodeApplicationProperties
protected org.apache.qpid.proton.amqp.messaging.ApplicationProperties lazyDecodeApplicationProperties()
-
lazyDecodeApplicationProperties
protected org.apache.qpid.proton.amqp.messaging.ApplicationProperties lazyDecodeApplicationProperties(org.apache.qpid.proton.codec.ReadableBuffer data)
-
unmarshalledApplicationPropertiesMemoryEstimateFromData
protected int unmarshalledApplicationPropertiesMemoryEstimateFromData(org.apache.qpid.proton.codec.ReadableBuffer data)
-
getApplicationPropertiesMap
protected Map<String,Object> getApplicationPropertiesMap(boolean createIfAbsent)
-
getMessageAnnotationsMap
protected Map<org.apache.qpid.proton.amqp.Symbol,Object> getMessageAnnotationsMap(boolean createIfAbsent)
-
getMessageAnnotation
protected Object getMessageAnnotation(org.apache.qpid.proton.amqp.Symbol annotation)
-
removeMessageAnnotation
protected Object removeMessageAnnotation(org.apache.qpid.proton.amqp.Symbol annotation)
-
setMessageAnnotation
protected void setMessageAnnotation(org.apache.qpid.proton.amqp.Symbol annotation, Object value)
-
setMessageAnnotations
protected void setMessageAnnotations(org.apache.qpid.proton.amqp.messaging.MessageAnnotations messageAnnotations)
-
ensureMessageDataScanned
protected void ensureMessageDataScanned()
-
getEstimateSavedEncode
protected int getEstimateSavedEncode()
-
resetMessageData
protected void resetMessageData()
-
scanMessageData
protected void scanMessageData()
-
scanMessageData
protected void scanMessageData(org.apache.qpid.proton.codec.ReadableBuffer data)
-
sendBuffer
public final void sendBuffer(io.netty.buffer.ByteBuf buffer, int deliveryCount)Would be called by the Artemis Core components to encode the message into the provided send buffer. Because of how Proton message data handling works this method is not currently used by the AMQP protocol head and will not be called for out-bound sends.- Specified by:
sendBufferin interfaceMessage- See Also:
for the actual method used for message sends.
-
getSendBuffer
public org.apache.qpid.proton.codec.ReadableBuffer getSendBuffer(int deliveryCount, org.apache.activemq.artemis.core.server.MessageReference reference)Gets a ByteBuf from the Message that contains the encoded bytes to be sent on the wire.When possible this method will present the bytes to the caller without copying them into a new buffer copy. If copying is needed a new Netty buffer is created and returned. The caller should ensure that the reference count on the returned buffer is always decremented to avoid a leak in the case of a copied buffer being returned.
- Parameters:
deliveryCount- The new delivery count for this message.- Returns:
- a Netty ByteBuf containing the encoded bytes of this Message instance.
-
createDeliveryCopy
protected org.apache.qpid.proton.codec.ReadableBuffer createDeliveryCopy(int deliveryCount, org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations)it will create a copy with the relevant delivery annotation and its copy
-
writeDeliveryAnnotationsForSendBuffer
protected void writeDeliveryAnnotationsForSendBuffer(io.netty.buffer.ByteBuf result, org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations)
-
getDeliveryAnnotationsForSendBufferSize
protected int getDeliveryAnnotationsForSendBufferSize()
-
messageChanged
public void messageChanged()
- Specified by:
messageChangedin interfaceMessage
-
getEncodeSize
public abstract int getEncodeSize()
- Specified by:
getEncodeSizein interfaceMessage
-
receiveBuffer
public final void receiveBuffer(io.netty.buffer.ByteBuf buffer)
- Specified by:
receiveBufferin interfaceMessage
-
getMemoryEstimate
public abstract int getMemoryEstimate()
- Specified by:
getMemoryEstimatein interfaceMessage
-
toPropertyMap
public Map<String,Object> toPropertyMap(int valueSizeLimit)
- Specified by:
toPropertyMapin interfaceMessage
-
addAnnotationsAsProperties
protected static void addAnnotationsAsProperties(String prefix, Map map, org.apache.qpid.proton.amqp.messaging.MessageAnnotations annotations)
-
toCore
public ICoreMessage toCore(org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)
-
toCore
public ICoreMessage toCore()
-
persist
public abstract void persist(ActiveMQBuffer targetRecord)
-
getPersistSize
public abstract int getPersistSize()
- Specified by:
getPersistSizein interfaceMessage
-
internalPersistSize
protected int internalPersistSize()
-
reloadPersistence
public abstract void reloadPersistence(ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)
- Specified by:
reloadPersistencein interfaceMessage
-
lazyScanAfterReloadPersistence
protected void lazyScanAfterReloadPersistence()
-
getPersistentSize
public abstract long getPersistentSize() throws ActiveMQException- Specified by:
getPersistentSizein interfaceMessage- Throws:
ActiveMQException
-
getPersister
public abstract org.apache.activemq.artemis.core.persistence.Persister<Message> getPersister()
- Specified by:
getPersisterin interfaceMessage
-
ensureDataIsValid
protected abstract void ensureDataIsValid()
-
encodeMessage
protected abstract void encodeMessage()
-
createExtraProperties
public final org.apache.activemq.artemis.utils.collections.TypedProperties createExtraProperties()
-
getExtraProperties
public final org.apache.activemq.artemis.utils.collections.TypedProperties getExtraProperties()
-
setExtraProperties
public final AMQPMessage setExtraProperties(org.apache.activemq.artemis.utils.collections.TypedProperties extraProperties)
-
putExtraBytesProperty
public final Message putExtraBytesProperty(SimpleString key, byte[] value)
- Specified by:
putExtraBytesPropertyin interfaceMessage
-
getExtraBytesProperty
public final byte[] getExtraBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getExtraBytesPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
clearInternalProperties
public void clearInternalProperties()
- Specified by:
clearInternalPropertiesin interfaceMessage
-
removeExtraBytesProperty
public final byte[] removeExtraBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
removeExtraBytesPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
setConnectionID
public final Message setConnectionID(String connectionID)
- Specified by:
setConnectionIDin interfaceMessage
-
getConnectionID
public final String getConnectionID()
- Specified by:
getConnectionIDin interfaceMessage
-
getMessageFormat
public final long getMessageFormat()
-
getMessageID
public final long getMessageID()
- Specified by:
getMessageIDin interfaceMessage
-
setMessageID
public final Message setMessageID(long id)
- Specified by:
setMessageIDin interfaceMessage
-
getExpiration
public final long getExpiration()
- Specified by:
getExpirationin interfaceMessage
-
reloadExpiration
public void reloadExpiration(long expiration)
-
setExpiration
public final AMQPMessage setExpiration(long expiration)
- Specified by:
setExpirationin interfaceMessage
-
getAMQPUserID
public final Object getAMQPUserID()
Before we added AMQP into Artemis the name getUserID was already taken by JMSMessageID. We cannot simply change the names now as it would break the API for existing clients. This is to return and read the proper AMQP userID.- Returns:
- the UserID value in the AMQP Properties if one is present.
-
getDuplicateProperty
public final Object getDuplicateProperty()
- Specified by:
getDuplicatePropertyin interfaceMessage
-
setDurable
public final Message setDurable(boolean durable)
- Specified by:
setDurablein interfaceMessage
-
getAddress
public final String getAddress()
- Specified by:
getAddressin interfaceMessage
-
setAddress
public final AMQPMessage setAddress(String address)
- Specified by:
setAddressin interfaceMessage
-
setAddress
public final AMQPMessage setAddress(SimpleString address)
- Specified by:
setAddressin interfaceMessage
-
getAddressSimpleString
public final SimpleString getAddressSimpleString()
- Specified by:
getAddressSimpleStringin interfaceMessage
-
cachedAddressSimpleString
protected SimpleString cachedAddressSimpleString(String address)
-
getTimestamp
public final long getTimestamp()
- Specified by:
getTimestampin interfaceMessage
-
setTimestamp
public final Message setTimestamp(long timestamp)
- Specified by:
setTimestampin interfaceMessage
-
getPriority
public final byte getPriority()
- Specified by:
getPriorityin interfaceMessage
-
setPriority
public final Message setPriority(byte priority)
- Specified by:
setPriorityin interfaceMessage
-
getReplyTo
public final SimpleString getReplyTo()
- Specified by:
getReplyToin interfaceMessage
-
setReplyTo
public final AMQPMessage setReplyTo(SimpleString address)
- Specified by:
setReplyToin interfaceMessage
-
getRoutingType
public final RoutingType getRoutingType()
- Specified by:
getRoutingTypein interfaceMessage
-
setRoutingType
public final Message setRoutingType(RoutingType routingType)
- Specified by:
setRoutingTypein interfaceMessage
-
getGroupID
public final SimpleString getGroupID()
- Specified by:
getGroupIDin interfaceMessage
-
getGroupSequence
public final int getGroupSequence()
- Specified by:
getGroupSequencein interfaceMessage
-
getCorrelationID
public final Object getCorrelationID()
- Specified by:
getCorrelationIDin interfaceMessage
-
setCorrelationID
public final Message setCorrelationID(Object correlationID)
- Specified by:
setCorrelationIDin interfaceMessage
-
hasScheduledDeliveryTime
public boolean hasScheduledDeliveryTime()
- Specified by:
hasScheduledDeliveryTimein interfaceMessage
-
getScheduledDeliveryTime
public final Long getScheduledDeliveryTime()
- Specified by:
getScheduledDeliveryTimein interfaceMessage
-
setScheduledDeliveryTime
public final AMQPMessage setScheduledDeliveryTime(Long time)
- Specified by:
setScheduledDeliveryTimein interfaceMessage
-
removeAnnotation
public final Object removeAnnotation(SimpleString key)
- Specified by:
removeAnnotationin interfaceMessage
-
getAnnotation
public final Object getAnnotation(SimpleString key)
- Specified by:
getAnnotationin interfaceMessage
-
setAnnotation
public final AMQPMessage setAnnotation(SimpleString key, Object value)
- Specified by:
setAnnotationin interfaceMessage
-
setBrokerProperty
public Message setBrokerProperty(SimpleString key, Object value)
- Specified by:
setBrokerPropertyin interfaceMessage
-
getBrokerProperty
public Object getBrokerProperty(SimpleString key)
- Specified by:
getBrokerPropertyin interfaceMessage
-
setIngressTimestamp
public final Message setIngressTimestamp()
- Specified by:
setIngressTimestampin interfaceMessage
-
getIngressTimestamp
public Long getIngressTimestamp()
- Specified by:
getIngressTimestampin interfaceMessage
-
removeProperty
public final Object removeProperty(SimpleString key)
- Specified by:
removePropertyin interfaceMessage
-
removeProperty
public final Object removeProperty(String key)
- Specified by:
removePropertyin interfaceMessage
-
containsProperty
public final boolean containsProperty(SimpleString key)
- Specified by:
containsPropertyin interfaceMessage
-
containsProperty
public final boolean containsProperty(String key)
- Specified by:
containsPropertyin interfaceMessage
-
getBooleanProperty
public final Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getBooleanPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getByteProperty
public final Byte getByteProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getBytePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getDoubleProperty
public final Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getDoublePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getIntProperty
public final Integer getIntProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getIntPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getLongProperty
public final Long getLongProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getLongPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getObjectProperty
public final Object getObjectProperty(String key)
- Specified by:
getObjectPropertyin interfaceMessage
-
getShortProperty
public final Short getShortProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getShortPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getFloatProperty
public final Float getFloatProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getFloatPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getStringProperty
public final String getStringProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getPropertyNames
public final Set<SimpleString> getPropertyNames()
- Specified by:
getPropertyNamesin interfaceMessage
-
getBooleanProperty
public final Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getBooleanPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getByteProperty
public final Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getBytePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getBytesProperty
public final byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getBytesPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getDoubleProperty
public final Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getDoublePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getIntProperty
public final Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getIntPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getLongProperty
public final Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getLongPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getObjectProperty
public final Object getObjectProperty(SimpleString key)
- Specified by:
getObjectPropertyin interfaceMessage
-
getShortProperty
public final Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getShortPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getFloatProperty
public final Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getFloatPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getStringProperty
public final String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getSimpleStringProperty
public final SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getSimpleStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getBytesProperty
public final byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getBytesPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getSimpleStringProperty
public final SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getSimpleStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putBooleanProperty
public final Message putBooleanProperty(String key, boolean value)
- Specified by:
putBooleanPropertyin interfaceMessage
-
putByteProperty
public final Message putByteProperty(String key, byte value)
- Specified by:
putBytePropertyin interfaceMessage
-
putBytesProperty
public final Message putBytesProperty(String key, byte[] value)
- Specified by:
putBytesPropertyin interfaceMessage
-
putShortProperty
public final Message putShortProperty(String key, short value)
- Specified by:
putShortPropertyin interfaceMessage
-
putCharProperty
public final Message putCharProperty(String key, char value)
- Specified by:
putCharPropertyin interfaceMessage
-
putIntProperty
public final Message putIntProperty(String key, int value)
- Specified by:
putIntPropertyin interfaceMessage
-
putLongProperty
public final Message putLongProperty(String key, long value)
- Specified by:
putLongPropertyin interfaceMessage
-
putFloatProperty
public final Message putFloatProperty(String key, float value)
- Specified by:
putFloatPropertyin interfaceMessage
-
putDoubleProperty
public final Message putDoubleProperty(String key, double value)
- Specified by:
putDoublePropertyin interfaceMessage
-
putBooleanProperty
public final Message putBooleanProperty(SimpleString key, boolean value)
- Specified by:
putBooleanPropertyin interfaceMessage
-
putByteProperty
public final Message putByteProperty(SimpleString key, byte value)
- Specified by:
putBytePropertyin interfaceMessage
-
putBytesProperty
public final Message putBytesProperty(SimpleString key, byte[] value)
- Specified by:
putBytesPropertyin interfaceMessage
-
putShortProperty
public final Message putShortProperty(SimpleString key, short value)
- Specified by:
putShortPropertyin interfaceMessage
-
putCharProperty
public final Message putCharProperty(SimpleString key, char value)
- Specified by:
putCharPropertyin interfaceMessage
-
putIntProperty
public final Message putIntProperty(SimpleString key, int value)
- Specified by:
putIntPropertyin interfaceMessage
-
putLongProperty
public final Message putLongProperty(SimpleString key, long value)
- Specified by:
putLongPropertyin interfaceMessage
-
putFloatProperty
public final Message putFloatProperty(SimpleString key, float value)
- Specified by:
putFloatPropertyin interfaceMessage
-
putDoubleProperty
public final Message putDoubleProperty(SimpleString key, double value)
- Specified by:
putDoublePropertyin interfaceMessage
-
putStringProperty
public final Message putStringProperty(String key, String value)
- Specified by:
putStringPropertyin interfaceMessage
-
putObjectProperty
public final Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
- Specified by:
putObjectPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putObjectProperty
public final Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
- Specified by:
putObjectPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putStringProperty
public final Message putStringProperty(SimpleString key, SimpleString value)
- Specified by:
putStringPropertyin interfaceMessage
-
putStringProperty
public final Message putStringProperty(SimpleString key, String value)
- Specified by:
putStringPropertyin interfaceMessage
-
getLastValueProperty
public final SimpleString getLastValueProperty()
- Specified by:
getLastValuePropertyin interfaceMessage
-
setLastValueProperty
public final Message setLastValueProperty(SimpleString lastValueName)
- Specified by:
setLastValuePropertyin interfaceMessage
-
acceptsConsumer
public final boolean acceptsConsumer(long consumer)
- Specified by:
acceptsConsumerin interfaceMessage
-
rejectConsumer
public final void rejectConsumer(long consumer)
- Specified by:
rejectConsumerin interfaceMessage
-
getPropertyKeysPool
protected SimpleString.StringSimpleStringPool getPropertyKeysPool()
-
getPropertyValuesPool
protected SimpleString.StringSimpleStringPool getPropertyValuesPool()
-
toCompositeData
public CompositeData toCompositeData(int fieldsLimit, int deliveryCount) throws OpenDataException
- Specified by:
toCompositeDatain interfaceMessage- Throws:
OpenDataException
-
-