Interface Message
-
- All Known Subinterfaces:
ClientMessage
,ICoreMessage
public interface Message
A 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
getFloatProperty
on a property set aboolean
), aActiveMQPropertyConversionException
will 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 Predicate<SimpleString>
AMQP_PROPERTY_PREDICATE
static byte
BYTES_TYPE
static byte
DEFAULT_TYPE
static byte
EMBEDDED_TYPE
The message will contain another message persisted through org.apache.activemq.artemis.spi.core.protocol.EmbedMessageUtilstatic SimpleString
HDR_ACTUAL_EXPIRY_TIME
the actual time the message was expired.static SimpleString
HDR_BRIDGE_DUPLICATE_ID
static SimpleString
HDR_CONTENT_TYPE
To define the mime-type of body messages.static SimpleString
HDR_DUPLICATE_DETECTION_ID
To be used with duplicate detection.static SimpleString
HDR_GROUP_ID
For the Message Grouping feature.static SimpleString
HDR_GROUP_SEQUENCE
static SimpleString
HDR_INGRESS_TIMESTAMP
The time at which the message arrived at the broker.static SimpleString
HDR_LARGE_BODY_SIZE
The body size of a large message before it was compressed.static SimpleString
HDR_LARGE_COMPRESSED
to determine if the Large Message was compressed.static SimpleString
HDR_LAST_VALUE_NAME
To be used with Last value queues.static SimpleString
HDR_ORIG_MESSAGE_ID
The original message ID before the message was transferred.static SimpleString
HDR_ORIG_ROUTING_TYPE
The original routing type of a message before getting transferred through DLQ or expirystatic SimpleString
HDR_ORIGINAL_ADDRESS
The original address of a message when a message is diverted or transferred through DLQ or expirystatic SimpleString
HDR_ORIGINAL_QUEUE
The original address of a message when a message is transferred through DLQ or expirystatic SimpleString
HDR_PREFIX
The prefix used (if any) when sending this message.static SimpleString
HDR_ROUTE_TO_ACK_IDS
static SimpleString
HDR_ROUTE_TO_IDS
static SimpleString
HDR_ROUTING_TYPE
The Routing Type for this message.static SimpleString
HDR_SCALEDOWN_TO_IDS
static SimpleString
HDR_SCHEDULED_DELIVERY_TIME
To be used with Scheduled Delivery.static SimpleString
HDR_VALIDATED_USER
The name of the validated user who sent the message.static Predicate<SimpleString>
INTERNAL_PROPERTY_NAMES_PREDICATE
static byte
LARGE_EMBEDDED_TYPE
This is to embedd Large Messages from other protocolstatic byte
MAP_TYPE
static int
memoryOffset
static byte
OBJECT_TYPE
static SimpleString
PREFIX_AMQP_ANNOTATIONS
static byte
STREAM_TYPE
static byte
TEXT_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
acceptsConsumer(long uniqueConsumerID)
default void
clearAMQPProperties()
default void
clearInternalProperties()
boolean
containsProperty(String key)
boolean
containsProperty(SimpleString key)
Message
copy()
It will generate a new instance of the message encode, being a deep copy, new properties, new everythingMessage
copy(long newID)
It will generate a new instance of the message encode, being a deep copy, new properties, new everythingdefault Message
copy(long newID, boolean isExpiryOrDLQ)
It will generate a new instance of the message encode, being a deep copy, new properties, new everythingint
durableDown()
int
durableUp()
String
getAddress()
SimpleString
getAddressSimpleString()
Object
getAnnotation(SimpleString key)
default String
getAnnotationString(SimpleString key)
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().default InputStream
getBodyInputStream()
Deprecated.do not use this, use through ICoreMessage or ClientMessageBoolean
getBooleanProperty(String key)
Boolean
getBooleanProperty(SimpleString key)
default Object
getBrokerProperty(SimpleString key)
Byte
getByteProperty(String key)
Byte
getByteProperty(SimpleString key)
byte[]
getBytesProperty(String key)
byte[]
getBytesProperty(SimpleString key)
default String
getConnectionID()
default Object
getCorrelationID()
Double
getDoubleProperty(String key)
Double
getDoubleProperty(SimpleString key)
default byte[]
getDuplicateIDBytes()
it will translate a property named HDR_DUPLICATE_DETECTION_ID.default Object
getDuplicateProperty()
int
getDurableCount()
int
getEncodeSize()
Returns the size of the encoded message.long
getExpiration()
Returns the expiration time of this message.default byte[]
getExtraBytesProperty(SimpleString key)
Float
getFloatProperty(String key)
Float
getFloatProperty(SimpleString key)
default SimpleString
getGroupID()
default int
getGroupSequence()
default Long
getIngressTimestamp()
Integer
getIntProperty(String key)
Integer
getIntProperty(SimpleString key)
default SimpleString
getLastValueProperty()
Long
getLongProperty(String key)
Long
getLongProperty(SimpleString key)
int
getMemoryEstimate()
long
getMessageID()
Returns the messageID.Object
getObjectProperty(String key)
Object
getObjectProperty(SimpleString key)
default Object
getObjectPropertyForFilter(SimpleString key)
default int
getOriginalEstimate()
The first estimate that's been calculated without any updates.Object
getOwner()
long
getPersistentSize()
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()
int
getPersistSize()
byte
getPriority()
Returns the message priority.Set<SimpleString>
getPropertyNames()
Returns all the names of the properties for this message.String
getProtocolName()
int
getRefCount()
SimpleString
getReplyTo()
default RoutingType
getRoutingType()
Long
getScheduledDeliveryTime()
Used to calculate what is the delivery time.Short
getShortProperty(String key)
Short
getShortProperty(SimpleString key)
SimpleString
getSimpleStringProperty(String key)
SimpleString
getSimpleStringProperty(SimpleString key)
default String
getStringBody()
String
getStringProperty(String key)
String
getStringProperty(SimpleString key)
long
getTimestamp()
default byte
getType()
Deprecated.do not use this, use through ICoreMessage or ClientMessageint
getUsage()
Object
getUserContext(Object key)
Used for user context data.Object
getUserID()
This represents historically the JMSMessageID.default String
getValidatedUserID()
default long
getWholeMessageSize()
Return an estimate of the size of the message on the wire.default boolean
hasScheduledDeliveryTime()
Search for the existence of the property: an implementor can save the message to be decoded, if possible.boolean
isDurable()
Returns whether this message is durable or not.default boolean
isExpired()
Returns whether this message is expired or not.default boolean
isLargeMessage()
boolean
isPaged()
void
messageChanged()
WARNING: Calling this method on a AMQPMessage will allow the non mutable part of the message to be modified.void
persist(ActiveMQBuffer targetRecord)
Message
putBooleanProperty(String key, boolean value)
Callers must callreencode()
in order to be sent to clientsMessage
putBooleanProperty(SimpleString key, boolean value)
Callers must callreencode()
in order to be sent to clientsMessage
putByteProperty(String key, byte value)
Callers must callreencode()
in order to be sent to clientsMessage
putByteProperty(SimpleString key, byte value)
Callers must callreencode()
in order to be sent to clientsMessage
putBytesProperty(String key, byte[] value)
Callers must callreencode()
in order to be sent to clientsMessage
putBytesProperty(SimpleString key, byte[] value)
Callers must callreencode()
in order to be sent to clientsMessage
putCharProperty(String key, char value)
Callers must callreencode()
in order to be sent to clientsMessage
putCharProperty(SimpleString key, char value)
Callers must callreencode()
in order to be sent to clientsMessage
putDoubleProperty(String key, double value)
Callers must callreencode()
in order to be sent to clientsMessage
putDoubleProperty(SimpleString key, double value)
Callers must callreencode()
in order to be sent to clientsdefault Message
putExtraBytesProperty(SimpleString key, byte[] value)
Message
putFloatProperty(String key, float value)
Callers must callreencode()
in order to be sent to clientsMessage
putFloatProperty(SimpleString key, float value)
Callers must callreencode()
in order to be sent to clientsMessage
putIntProperty(String key, int value)
Callers must callreencode()
in order to be sent to clientsMessage
putIntProperty(SimpleString key, int value)
Callers must callreencode()
in order to be sent to clientsMessage
putLongProperty(String key, long value)
Callers must callreencode()
in order to be sent to clientsMessage
putLongProperty(SimpleString key, long value)
Callers must callreencode()
in order to be sent to clientsMessage
putObjectProperty(String key, Object value)
Callers must callreencode()
in order to be sent to clientsMessage
putObjectProperty(SimpleString key, Object value)
Callers must callreencode()
in order to be sent to clientsMessage
putShortProperty(String key, short value)
Callers must callreencode()
in order to be sent to clientsMessage
putShortProperty(SimpleString key, short value)
Callers must callreencode()
in order to be sent to clientsMessage
putStringProperty(String key, String value)
Puts a String property in this message.Message
putStringProperty(SimpleString key, String value)
Message
putStringProperty(SimpleString key, SimpleString value)
void
receiveBuffer(io.netty.buffer.ByteBuf buffer)
Used to receive this message from an encoded medium bufferdefault void
reencode()
Propagate message modifications to clients.int
refDown()
default void
referenceOriginalMessage(Message original, SimpleString originalQueue)
int
refUp()
default void
rejectConsumer(long uniqueConsumerID)
void
reloadPersistence(ActiveMQBuffer record, org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools pools)
default Object
removeAnnotation(SimpleString key)
default byte[]
removeExtraBytesProperty(SimpleString key)
Object
removeProperty(String key)
Object
removeProperty(SimpleString key)
void
sendBuffer(io.netty.buffer.ByteBuf buffer, int deliveryCount)
Used to send this message to an encoded medium buffer.Message
setAddress(String address)
Look atsetAddress(SimpleString)
for the doc.Message
setAddress(SimpleString address)
This will set the address on CoreMessage.default Message
setAnnotation(SimpleString key, Object value)
Callers must callreencode()
in order to be sent to clientsdefault Message
setBrokerProperty(SimpleString key, Object value)
To be called by the broker on ocasions such as DLQ and expiry.default Message
setConnectionID(String connectionID)
default Message
setCorrelationID(Object correlationID)
Message
setDurable(boolean durable)
Sets whether this message is durable or not.Message
setExpiration(long expiration)
Sets the expiration of this message.default Message
setGroupID(String groupID)
default Message
setGroupID(SimpleString groupID)
default Message
setGroupSequence(int sequence)
default Message
setIngressTimestamp()
default Message
setLastValueProperty(SimpleString lastValueName)
Message
setMessageID(long id)
void
setOwner(Object object)
void
setPaged()
Message
setPriority(byte priority)
Sets the message priority.Message
setReplyTo(SimpleString address)
default Message
setRoutingType(RoutingType routingType)
default Message
setScheduledDeliveryTime(Long time)
Message
setTimestamp(long timestamp)
default Message
setType(byte type)
Deprecated.do not use this, use through ICoreMessage or ClientMessagevoid
setUserContext(Object key, Object value)
Used for user context data.Message
setUserID(Object userID)
default Message
setValidatedUserID(String validatedUserID)
default CompositeData
toCompositeData(int fieldsLimit, int deliveryCount)
ICoreMessage
toCore()
This should make you convert your message into Core format.ICoreMessage
toCore(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)
int
usageDown()
int
usageUp()
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
-
PREFIX_AMQP_ANNOTATIONS
static final SimpleString PREFIX_AMQP_ANNOTATIONS
-
INTERNAL_PROPERTY_NAMES_PREDICATE
static final Predicate<SimpleString> INTERNAL_PROPERTY_NAMES_PREDICATE
-
AMQP_PROPERTY_PREDICATE
static final Predicate<SimpleString> AMQP_PROPERTY_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()
-
clearAMQPProperties
default void clearAMQPProperties()
-
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.
-
setPaged
void setPaged()
-
isPaged
boolean isPaged()
-
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
-true
to flag this message as durable,false
else
-
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()
Propagate message modifications to clients.
-
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(String key, boolean value)
Callers must callreencode()
in order to be sent to clients
-
putByteProperty
Message putByteProperty(String key, byte value)
Callers must callreencode()
in order to be sent to clients
-
putBytesProperty
Message putBytesProperty(String key, byte[] value)
Callers must callreencode()
in order to be sent to clients
-
putShortProperty
Message putShortProperty(String key, short value)
Callers must callreencode()
in order to be sent to clients
-
putCharProperty
Message putCharProperty(String key, char value)
Callers must callreencode()
in order to be sent to clients
-
putIntProperty
Message putIntProperty(String key, int value)
Callers must callreencode()
in order to be sent to clients
-
putLongProperty
Message putLongProperty(String key, long value)
Callers must callreencode()
in order to be sent to clients
-
putFloatProperty
Message putFloatProperty(String key, float value)
Callers must callreencode()
in order to be sent to clients
-
putDoubleProperty
Message putDoubleProperty(String key, double value)
Callers must callreencode()
in order to be sent to clients
-
putBooleanProperty
Message putBooleanProperty(SimpleString key, boolean value)
Callers must callreencode()
in order to be sent to clients
-
putByteProperty
Message putByteProperty(SimpleString key, byte value)
Callers must callreencode()
in order to be sent to clients
-
putBytesProperty
Message putBytesProperty(SimpleString key, byte[] value)
Callers must callreencode()
in order to be sent to clients
-
putShortProperty
Message putShortProperty(SimpleString key, short value)
Callers must callreencode()
in order to be sent to clients
-
putCharProperty
Message putCharProperty(SimpleString key, char value)
Callers must callreencode()
in order to be sent to clients
-
putIntProperty
Message putIntProperty(SimpleString key, int value)
Callers must callreencode()
in order to be sent to clients
-
putLongProperty
Message putLongProperty(SimpleString key, long value)
Callers must callreencode()
in order to be sent to clients
-
putFloatProperty
Message putFloatProperty(SimpleString key, float value)
Callers must callreencode()
in order to be sent to clients
-
putDoubleProperty
Message putDoubleProperty(SimpleString key, double value)
Callers must callreencode()
in order to be sent to clients
-
putStringProperty
Message putStringProperty(String key, String value)
Puts a String property in this message.Callers must call
reencode()
in order to be sent to clients- Parameters:
key
- property namevalue
- property value
-
putObjectProperty
Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
Callers must callreencode()
in order to be sent to clients
-
putObjectProperty
Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
Callers must callreencode()
in order to be sent to clients
-
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()
-
getOriginalEstimate
default int getOriginalEstimate()
The first estimate that's been calculated without any updates.
-
getPersistentSize
long getPersistentSize() throws ActiveMQException
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 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.
-
-