Interface Message
-
- All Known Subinterfaces:
ClientMessage,ICoreMessage
public interface MessageA Message is a routable instance that has a payload.The payload (the "body") is opaque to the messaging system. A Message also has a fixed set of headers (required by the messaging system) and properties (defined by the users) that can be used by the messaging system to route the message (e.g. to ensure it matches a queue filter).
Message Properties
Message can contain properties specified by the users. It is possible to convert from some types to other types as specified by the following table:
| | boolean byte short int long float double String byte[] |---------------------------------------------------------------- |boolean | X X |byte | X X X X X |short | X X X X |int | X X X |long | X X |float | X X X |double | X X |String | X X X X X X X X |byte[] | X |-----------------------------------------------------------------
If conversion is not allowed (for example calling
getFloatPropertyon a property set aboolean), aActiveMQPropertyConversionExceptionwill be thrown. User cases that will be covered by Message Receiving a buffer: Message encode = new CoreMessage(); // or any other implementation encode.receiveBuffer(buffer); Sending to a buffer: Message encode; size = encode.getEncodeSize(); encode.encodeDirectly(bufferOutput);
-
-
Field Summary
Fields Modifier and Type Field Description static byteBYTES_TYPEstatic byteDEFAULT_TYPEstatic byteEMBEDDED_TYPEThe message will contain another message persisted through org.apache.activemq.artemis.spi.core.protocol.EmbedMessageUtilstatic SimpleStringHDR_ACTUAL_EXPIRY_TIMEthe actual time the message was expired.static SimpleStringHDR_BRIDGE_DUPLICATE_IDstatic SimpleStringHDR_CONTENT_TYPETo define the mime-type of body messages.static SimpleStringHDR_DUPLICATE_DETECTION_IDTo be used with duplicate detection.static SimpleStringHDR_GROUP_IDFor the Message Grouping feature.static SimpleStringHDR_GROUP_SEQUENCEstatic SimpleStringHDR_INGRESS_TIMESTAMPThe time at which the message arrived at the broker.static SimpleStringHDR_LARGE_BODY_SIZEThe body size of a large message before it was compressed.static SimpleStringHDR_LARGE_COMPRESSEDto determine if the Large Message was compressed.static SimpleStringHDR_LAST_VALUE_NAMETo be used with Last value queues.static SimpleStringHDR_ORIG_MESSAGE_IDThe original message ID before the message was transferred.static SimpleStringHDR_ORIG_ROUTING_TYPEThe original routing type of a message before getting transferred through DLQ or expirystatic SimpleStringHDR_ORIGINAL_ADDRESSThe original address of a message when a message is diverted or transferred through DLQ or expirystatic SimpleStringHDR_ORIGINAL_QUEUEThe original address of a message when a message is transferred through DLQ or expirystatic SimpleStringHDR_PREFIXThe prefix used (if any) when sending this message.static SimpleStringHDR_ROUTE_TO_ACK_IDSstatic SimpleStringHDR_ROUTE_TO_IDSstatic SimpleStringHDR_ROUTING_TYPEThe Routing Type for this message.static SimpleStringHDR_SCALEDOWN_TO_IDSstatic SimpleStringHDR_SCHEDULED_DELIVERY_TIMETo be used with Scheduled Delivery.static SimpleStringHDR_VALIDATED_USERThe name of the validated user who sent the message.static Predicate<SimpleString>INTERNAL_PROPERTY_NAMES_PREDICATEstatic byteLARGE_EMBEDDED_TYPEThis is to embedd Large Messages from other protocolstatic byteMAP_TYPEstatic intmemoryOffsetstatic byteOBJECT_TYPEstatic byteSTREAM_TYPEstatic byteTEXT_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default booleanacceptsConsumer(long uniqueConsumerID)default voidclearInternalProperties()booleancontainsProperty(String key)booleancontainsProperty(SimpleString key)Messagecopy()It will generate a new instance of the message encode, being a deep copy, new properties, new everythingMessagecopy(long newID)It will generate a new instance of the message encode, being a deep copy, new properties, new everythingdefault Messagecopy(long newID, boolean isExpiryOrDLQ)It will generate a new instance of the message encode, being a deep copy, new properties, new everythingintdurableDown()intdurableUp()StringgetAddress()SimpleStringgetAddressSimpleString()ObjectgetAnnotation(SimpleString key)default StringgetAnnotationString(SimpleString key)default ActiveMQBuffergetBodyBuffer()Deprecated.do not use this, use through ICoreMessage or ClientMessage Warning: if you need to read the content of a message use getDataBuffer().default InputStreamgetBodyInputStream()Deprecated.do not use this, use through ICoreMessage or ClientMessageBooleangetBooleanProperty(String key)BooleangetBooleanProperty(SimpleString key)default ObjectgetBrokerProperty(SimpleString key)BytegetByteProperty(String key)BytegetByteProperty(SimpleString key)byte[]getBytesProperty(String key)byte[]getBytesProperty(SimpleString key)default StringgetConnectionID()default ObjectgetCorrelationID()DoublegetDoubleProperty(String key)DoublegetDoubleProperty(SimpleString key)default byte[]getDuplicateIDBytes()it will translate a property named HDR_DUPLICATE_DETECTION_ID.default ObjectgetDuplicateProperty()intgetDurableCount()intgetEncodeSize()Returns the size of the encoded message.longgetExpiration()Returns the expiration time of this message.default byte[]getExtraBytesProperty(SimpleString key)FloatgetFloatProperty(String key)FloatgetFloatProperty(SimpleString key)default SimpleStringgetGroupID()default intgetGroupSequence()default LonggetIngressTimestamp()IntegergetIntProperty(String key)IntegergetIntProperty(SimpleString key)default SimpleStringgetLastValueProperty()LonggetLongProperty(String key)LonggetLongProperty(SimpleString key)intgetMemoryEstimate()longgetMessageID()Returns the messageID.ObjectgetObjectProperty(String key)ObjectgetObjectProperty(SimpleString key)default ObjectgetObjectPropertyForFilter(SimpleString key)ObjectgetOwner()longgetPersistentSize()This 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 sizeorg.apache.activemq.artemis.core.persistence.Persister<Message>getPersister()intgetPersistSize()bytegetPriority()Returns the message priority.Set<SimpleString>getPropertyNames()Returns all the names of the properties for this message.StringgetProtocolName()intgetRefCount()SimpleStringgetReplyTo()default RoutingTypegetRoutingType()LonggetScheduledDeliveryTime()Used to calculate what is the delivery time.ShortgetShortProperty(String key)ShortgetShortProperty(SimpleString key)SimpleStringgetSimpleStringProperty(String key)SimpleStringgetSimpleStringProperty(SimpleString key)default StringgetStringBody()StringgetStringProperty(String key)StringgetStringProperty(SimpleString key)longgetTimestamp()default bytegetType()Deprecated.do not use this, use through ICoreMessage or ClientMessageintgetUsage()ObjectgetUserContext(Object key)Used for user context data.ObjectgetUserID()This represents historically the JMSMessageID.default StringgetValidatedUserID()default longgetWholeMessageSize()Return an estimate of the size of the message on the wire.default booleanhasScheduledDeliveryTime()Search for the existence of the property: an implementor can save the message to be decoded, if possible.booleanisDurable()Returns whether this message is durable or not.default booleanisExpired()Returns whether this message is expired or not.default booleanisLargeMessage()voidmessageChanged()WARNING: Calling this method on a AMQPMessage will allow the non mutable part of the message to be modified.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)default 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)Puts a String property in this message.MessageputStringProperty(SimpleString key, String value)MessageputStringProperty(SimpleString key, SimpleString value)voidreceiveBuffer(io.netty.buffer.ByteBuf buffer)Used to receive this message from an encoded medium bufferdefault voidreencode()intrefDown()default voidreferenceOriginalMessage(Message original, SimpleString originalQueue)intrefUp()default voidrejectConsumer(long uniqueConsumerID)voidreloadPersistence(ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)default ObjectremoveAnnotation(SimpleString key)default byte[]removeExtraBytesProperty(SimpleString key)ObjectremoveProperty(String key)ObjectremoveProperty(SimpleString key)voidsendBuffer(io.netty.buffer.ByteBuf buffer, int deliveryCount)Used to send this message to an encoded medium buffer.MessagesetAddress(String address)Look atsetAddress(SimpleString)for the doc.MessagesetAddress(SimpleString address)This will set the address on CoreMessage.default MessagesetAnnotation(SimpleString key, Object value)Callers must callreencode()in order to be sent to clientsdefault MessagesetBrokerProperty(SimpleString key, Object value)To be called by the broker on ocasions such as DLQ and expiry.default MessagesetConnectionID(String connectionID)default MessagesetCorrelationID(Object correlationID)MessagesetDurable(boolean durable)Sets whether this message is durable or not.MessagesetExpiration(long expiration)Sets the expiration of this message.default MessagesetGroupID(String groupID)default MessagesetGroupID(SimpleString groupID)default MessagesetGroupSequence(int sequence)default MessagesetIngressTimestamp()default MessagesetLastValueProperty(SimpleString lastValueName)MessagesetMessageID(long id)voidsetOwner(Object object)MessagesetPriority(byte priority)Sets the message priority.MessagesetReplyTo(SimpleString address)default MessagesetRoutingType(RoutingType routingType)default MessagesetScheduledDeliveryTime(Long time)MessagesetTimestamp(long timestamp)default MessagesetType(byte type)Deprecated.do not use this, use through ICoreMessage or ClientMessagevoidsetUserContext(Object key, Object value)Used for user context data.MessagesetUserID(Object userID)default MessagesetValidatedUserID(String validatedUserID)default CompositeDatatoCompositeData(int fieldsLimit, int deliveryCount)ICoreMessagetoCore()This should make you convert your message into Core format.ICoreMessagetoCore(org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)This should make you convert your message into Core format.default Map<String,Object>toMap()default Map<String,Object>toMap(int valueSizeLimit)default Map<String,Object>toPropertyMap()default Map<String,Object>toPropertyMap(int valueSizeLimit)intusageDown()intusageUp()this method indicates usage by components such as large message or page cache.
-
-
-
Field Detail
-
memoryOffset
static final int memoryOffset
- See Also:
- Constant Field Values
-
INTERNAL_PROPERTY_NAMES_PREDICATE
static final Predicate<SimpleString> INTERNAL_PROPERTY_NAMES_PREDICATE
-
HDR_ROUTE_TO_IDS
static final SimpleString HDR_ROUTE_TO_IDS
-
HDR_SCALEDOWN_TO_IDS
static final SimpleString HDR_SCALEDOWN_TO_IDS
-
HDR_ROUTE_TO_ACK_IDS
static final SimpleString HDR_ROUTE_TO_ACK_IDS
-
HDR_BRIDGE_DUPLICATE_ID
static final SimpleString HDR_BRIDGE_DUPLICATE_ID
-
HDR_ACTUAL_EXPIRY_TIME
static final SimpleString HDR_ACTUAL_EXPIRY_TIME
the actual time the message was expired. * *
-
HDR_ORIGINAL_ADDRESS
static final SimpleString HDR_ORIGINAL_ADDRESS
The original address of a message when a message is diverted or transferred through DLQ or expiry
-
HDR_ORIGINAL_QUEUE
static final SimpleString HDR_ORIGINAL_QUEUE
The original address of a message when a message is transferred through DLQ or expiry
-
HDR_ORIG_MESSAGE_ID
static final SimpleString HDR_ORIG_MESSAGE_ID
The original message ID before the message was transferred.
-
HDR_GROUP_ID
static final SimpleString HDR_GROUP_ID
For the Message Grouping feature.
-
HDR_GROUP_SEQUENCE
static final SimpleString HDR_GROUP_SEQUENCE
-
HDR_LARGE_COMPRESSED
static final SimpleString HDR_LARGE_COMPRESSED
to determine if the Large Message was compressed.
-
HDR_LARGE_BODY_SIZE
static final SimpleString HDR_LARGE_BODY_SIZE
The body size of a large message before it was compressed.
-
HDR_SCHEDULED_DELIVERY_TIME
static final SimpleString HDR_SCHEDULED_DELIVERY_TIME
To be used with Scheduled Delivery.
-
HDR_DUPLICATE_DETECTION_ID
static final SimpleString HDR_DUPLICATE_DETECTION_ID
To be used with duplicate detection.
-
HDR_LAST_VALUE_NAME
static final SimpleString HDR_LAST_VALUE_NAME
To be used with Last value queues.
-
HDR_CONTENT_TYPE
static final SimpleString HDR_CONTENT_TYPE
To define the mime-type of body messages. Mainly for stomp but it could be informed on any message for user purposes.
-
HDR_VALIDATED_USER
static final SimpleString HDR_VALIDATED_USER
The name of the validated user who sent the message. Useful for auditing.
-
HDR_ROUTING_TYPE
static final SimpleString HDR_ROUTING_TYPE
The Routing Type for this message. Ensures that this message is only routed to queues with matching routing type.
-
HDR_ORIG_ROUTING_TYPE
static final SimpleString HDR_ORIG_ROUTING_TYPE
The original routing type of a message before getting transferred through DLQ or expiry
-
HDR_INGRESS_TIMESTAMP
static final SimpleString HDR_INGRESS_TIMESTAMP
The time at which the message arrived at the broker.
-
HDR_PREFIX
static final SimpleString HDR_PREFIX
The prefix used (if any) when sending this message. For protocols (e.g. STOMP) that need to track this and restore the prefix when the message is consumed.
-
DEFAULT_TYPE
static final byte DEFAULT_TYPE
- See Also:
- Constant Field Values
-
OBJECT_TYPE
static final byte OBJECT_TYPE
- See Also:
- Constant Field Values
-
TEXT_TYPE
static final byte TEXT_TYPE
- See Also:
- Constant Field Values
-
BYTES_TYPE
static final byte BYTES_TYPE
- See Also:
- Constant Field Values
-
MAP_TYPE
static final byte MAP_TYPE
- See Also:
- Constant Field Values
-
STREAM_TYPE
static final byte STREAM_TYPE
- See Also:
- Constant Field Values
-
EMBEDDED_TYPE
static final byte EMBEDDED_TYPE
The message will contain another message persisted through org.apache.activemq.artemis.spi.core.protocol.EmbedMessageUtil- See Also:
- Constant Field Values
-
LARGE_EMBEDDED_TYPE
static final byte LARGE_EMBEDDED_TYPE
This is to embedd Large Messages from other protocol- See Also:
- Constant Field Values
-
-
Method Detail
-
clearInternalProperties
default void clearInternalProperties()
-
hasScheduledDeliveryTime
default boolean hasScheduledDeliveryTime()
Search for the existence of the property: an implementor can save the message to be decoded, if possible.
-
getRoutingType
default RoutingType getRoutingType()
-
setRoutingType
default Message setRoutingType(RoutingType routingType)
-
getLastValueProperty
default SimpleString getLastValueProperty()
-
setLastValueProperty
default Message setLastValueProperty(SimpleString lastValueName)
-
getBodyInputStream
@Deprecated default InputStream getBodyInputStream()
Deprecated.do not use this, use through ICoreMessage or ClientMessage
-
getBodyBuffer
@Deprecated default ActiveMQBuffer getBodyBuffer()
Deprecated.do not use this, use through ICoreMessage or ClientMessage Warning: if you need to read the content of a message use getDataBuffer(). This method is intended for when you want to make changes.
-
getType
@Deprecated default byte getType()
Deprecated.do not use this, use through ICoreMessage or ClientMessage
-
setType
@Deprecated default Message setType(byte type)
Deprecated.do not use this, use through ICoreMessage or ClientMessage
-
messageChanged
void messageChanged()
WARNING: Calling this method on a AMQPMessage will allow the non mutable part of the message to be modified.
-
getScheduledDeliveryTime
Long getScheduledDeliveryTime()
Used to calculate what is the delivery time. Return null if not scheduled.
-
getGroupID
default SimpleString getGroupID()
-
setGroupID
default Message setGroupID(SimpleString groupID)
-
getGroupSequence
default int getGroupSequence()
-
setGroupSequence
default Message setGroupSequence(int sequence)
-
getCorrelationID
default Object getCorrelationID()
-
getReplyTo
SimpleString getReplyTo()
-
setReplyTo
Message setReplyTo(SimpleString address)
-
copy
Message copy()
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
-
copy
Message copy(long newID)
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
-
copy
default Message copy(long newID, boolean isExpiryOrDLQ)
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
-
acceptsConsumer
default boolean acceptsConsumer(long uniqueConsumerID)
-
rejectConsumer
default void rejectConsumer(long uniqueConsumerID)
-
getMessageID
long getMessageID()
Returns the messageID.
The messageID is set when the message is handled by the server.
-
getProtocolName
String getProtocolName()
-
getConnectionID
default String getConnectionID()
-
setMessageID
Message setMessageID(long id)
-
isLargeMessage
default boolean isLargeMessage()
-
getExpiration
long getExpiration()
Returns the expiration time of this message.
-
setExpiration
Message setExpiration(long expiration)
Sets the expiration of this message.- Parameters:
expiration- expiration time
-
isExpired
default boolean isExpired()
Returns whether this message is expired or not.
-
getUserID
Object getUserID()
This represents historically the JMSMessageID. We had in the past used this for the MessageID that was sent on core messages... later on when we added AMQP this name clashed with AMQPMessage.getUserID();- Returns:
- the user id
-
getValidatedUserID
default String getValidatedUserID()
-
isDurable
boolean isDurable()
Returns whether this message is durable or not.
-
setDurable
Message setDurable(boolean durable)
Sets whether this message is durable or not.- Parameters:
durable-trueto flag this message as durable,falseelse
-
getPersister
org.apache.activemq.artemis.core.persistence.Persister<Message> getPersister()
-
getAddress
String getAddress()
-
setAddress
Message setAddress(String address)
Look atsetAddress(SimpleString)for the doc.- Parameters:
address-- Returns:
-
getAddressSimpleString
SimpleString getAddressSimpleString()
-
setAddress
Message setAddress(SimpleString address)
This will set the address on CoreMessage. Note for AMQPMessages: in AMQPMessages this will not really change the address on the message. Instead it will add a property on extraProperties which only transverse internally at the broker. Whatever you change here it won't affect anything towards the received message. If you wish to change AMQPMessages address you will have to do it directly at the AMQP Message, however beware that AMQPMessages are not supposed to be changed at the broker, so only do it if you know what you are doing.- Parameters:
address-- Returns:
-
getTimestamp
long getTimestamp()
-
setTimestamp
Message setTimestamp(long timestamp)
-
getPriority
byte getPriority()
Returns the message priority.Values range from 0 (less priority) to 9 (more priority) inclusive.
-
setPriority
Message setPriority(byte priority)
Sets the message priority.Value must be between 0 and 9 inclusive.
- Parameters:
priority- the new message priority
-
receiveBuffer
void receiveBuffer(io.netty.buffer.ByteBuf buffer)
Used to receive this message from an encoded medium buffer
-
sendBuffer
void sendBuffer(io.netty.buffer.ByteBuf buffer, int deliveryCount)Used to send this message to an encoded medium buffer.- Parameters:
buffer- the buffer used.deliveryCount- Some protocols (AMQP) will have this as part of the message.
-
getPersistSize
int getPersistSize()
-
persist
void persist(ActiveMQBuffer targetRecord)
-
reloadPersistence
void reloadPersistence(ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)
-
reencode
default void reencode()
-
referenceOriginalMessage
default void referenceOriginalMessage(Message original, SimpleString originalQueue)
-
getDuplicateIDBytes
default byte[] getDuplicateIDBytes()
it will translate a property named HDR_DUPLICATE_DETECTION_ID.- Returns:
-
putExtraBytesProperty
default Message putExtraBytesProperty(SimpleString key, byte[] value)
-
getExtraBytesProperty
default byte[] getExtraBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
removeExtraBytesProperty
default byte[] removeExtraBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getDuplicateProperty
default Object getDuplicateProperty()
-
putBooleanProperty
Message putBooleanProperty(SimpleString key, boolean value)
-
putByteProperty
Message putByteProperty(SimpleString key, byte value)
-
putBytesProperty
Message putBytesProperty(SimpleString key, byte[] value)
-
putShortProperty
Message putShortProperty(SimpleString key, short value)
-
putCharProperty
Message putCharProperty(SimpleString key, char value)
-
putIntProperty
Message putIntProperty(SimpleString key, int value)
-
putLongProperty
Message putLongProperty(SimpleString key, long value)
-
putFloatProperty
Message putFloatProperty(SimpleString key, float value)
-
putDoubleProperty
Message putDoubleProperty(SimpleString key, double value)
-
putStringProperty
Message putStringProperty(String key, String value)
Puts a String property in this message.- Parameters:
key- property namevalue- property value
-
putObjectProperty
Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
-
putObjectProperty
Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
-
containsProperty
boolean containsProperty(String key)
-
getBooleanProperty
Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException
-
getByteProperty
Byte getByteProperty(String key) throws ActiveMQPropertyConversionException
-
getDoubleProperty
Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException
-
getIntProperty
Integer getIntProperty(String key) throws ActiveMQPropertyConversionException
-
getLongProperty
Long getLongProperty(String key) throws ActiveMQPropertyConversionException
-
getShortProperty
Short getShortProperty(String key) throws ActiveMQPropertyConversionException
-
getFloatProperty
Float getFloatProperty(String key) throws ActiveMQPropertyConversionException
-
getStringProperty
String getStringProperty(String key) throws ActiveMQPropertyConversionException
-
getSimpleStringProperty
SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException
-
getBytesProperty
byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException
-
removeProperty
Object removeProperty(SimpleString key)
-
containsProperty
boolean containsProperty(SimpleString key)
-
getBooleanProperty
Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getByteProperty
Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getDoubleProperty
Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getIntProperty
Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getLongProperty
Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getObjectPropertyForFilter
default Object getObjectPropertyForFilter(SimpleString key)
-
getObjectProperty
Object getObjectProperty(SimpleString key)
-
removeAnnotation
default Object removeAnnotation(SimpleString key)
-
getAnnotationString
default String getAnnotationString(SimpleString key)
-
getAnnotation
Object getAnnotation(SimpleString key)
-
setAnnotation
default Message setAnnotation(SimpleString key, Object value)
Callers must callreencode()in order to be sent to clients
-
setBrokerProperty
default Message setBrokerProperty(SimpleString key, Object value)
To be called by the broker on ocasions such as DLQ and expiry. When the broker is adding additional properties.
-
getBrokerProperty
default Object getBrokerProperty(SimpleString key)
-
setIngressTimestamp
default Message setIngressTimestamp()
-
getIngressTimestamp
default Long getIngressTimestamp()
-
getShortProperty
Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getFloatProperty
Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getStringProperty
String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getSimpleStringProperty
SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
getBytesProperty
byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
-
putStringProperty
Message putStringProperty(SimpleString key, SimpleString value)
-
putStringProperty
Message putStringProperty(SimpleString key, String value)
-
getEncodeSize
int getEncodeSize()
Returns the size of the encoded message.
-
getWholeMessageSize
default long getWholeMessageSize()
Return 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.- Returns:
-
getPropertyNames
Set<SimpleString> getPropertyNames()
Returns all the names of the properties for this message.
-
getRefCount
int getRefCount()
-
getUsage
int getUsage()
-
getDurableCount
int getDurableCount()
-
usageUp
int usageUp()
this method indicates usage by components such as large message or page cache. This method will cause large messages to be held longer after the ack happened for instance.
-
usageDown
int usageDown()
- Returns:
- See Also:
usageUp()
-
refUp
int refUp()
-
refDown
int refDown()
-
durableUp
int durableUp()
-
durableDown
int durableDown()
-
toMap
default Map<String,Object> toMap()
- Returns:
- Returns the message in Map form, useful when encoding to JSON
-
toMap
default Map<String,Object> toMap(int valueSizeLimit)
- Parameters:
valueSizeLimit- that limits [] map values- Returns:
- Returns the message in Map form, useful when encoding to JSON
-
toPropertyMap
default Map<String,Object> toPropertyMap()
- Returns:
- Returns the message properties in Map form, useful when encoding to JSON
-
toPropertyMap
default Map<String,Object> toPropertyMap(int valueSizeLimit)
- Parameters:
valueSizeLimit- that limits [] map values- Returns:
- Returns the message properties in Map form, useful when encoding to JSON
-
toCore
ICoreMessage toCore()
This should make you convert your message into Core format.
-
toCompositeData
default CompositeData toCompositeData(int fieldsLimit, int deliveryCount) throws OpenDataException
- Throws:
OpenDataException
-
toCore
ICoreMessage toCore(org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools coreMessageObjectPools)
This should make you convert your message into Core format.
-
getMemoryEstimate
int getMemoryEstimate()
-
getPersistentSize
long getPersistentSize() throws ActiveMQExceptionThis 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- Returns:
- Throws:
ActiveMQException
-
getOwner
Object getOwner()
-
setOwner
void setOwner(Object object)
-
getStringBody
default String getStringBody()
-
getUserContext
Object getUserContext(Object key)
Used for user context data. Useful on interceptors.
-
-