org.apache.activemq.artemis.api.core

## 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 a `boolean`), a `ActiveMQPropertyConversionException` 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 and Description
    --- | ---
    `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.EmbedMessageUtil
    `static 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 expiry
    `static SimpleString` | `HDR_ORIGINAL_ADDRESS` The original address of a message when a message is diverted or transferred through DLQ or expiry
    `static SimpleString` | `HDR_ORIGINAL_QUEUE` The original address of a message when a message is transferred through DLQ or expiry
    `static 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 protocol
    `static byte` | `MAP_TYPE`
    `static int` | `memoryOffset`
    `static byte` | `OBJECT_TYPE`
    `static byte` | `STREAM_TYPE`
    `static byte` | `TEXT_TYPE`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default boolean` | `acceptsConsumer(long uniqueConsumerID)`
    `default void` | `clearInternalProperties()`
    `boolean` | `containsProperty(SimpleString key)`
    `boolean` | `containsProperty(String key)`
    `Message` | `copy()` It will generate a new instance of the message encode, being a deep copy, new properties, new everything
    `Message` | `copy(long newID)` It will generate a new instance of the message encode, being a deep copy, new properties, new everything
    `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
    `int` | `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(). This method is intended for when you want to make changes.
    `default InputStream` | `getBodyInputStream()` Deprecated. do not use this, use through ICoreMessage or ClientMessage
    `Boolean` | `getBooleanProperty(SimpleString key)`
    `Boolean` | `getBooleanProperty(String key)`
    `default Object` | `getBrokerProperty(SimpleString key)`
    `Byte` | `getByteProperty(SimpleString key)`
    `Byte` | `getByteProperty(String key)`
    `byte[]` | `getBytesProperty(SimpleString key)`
    `byte[]` | `getBytesProperty(String key)`
    `default String` | `getConnectionID()`
    `default Object` | `getCorrelationID()`
    `Double` | `getDoubleProperty(SimpleString key)`
    `Double` | `getDoubleProperty(String 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(SimpleString key)`
    `Float` | `getFloatProperty(String key)`
    `default SimpleString` | `getGroupID()`
    `default int` | `getGroupSequence()`
    `default Long` | `getIngressTimestamp()`
    `Integer` | `getIntProperty(SimpleString key)`
    `Integer` | `getIntProperty(String key)`
    `default SimpleString` | `getLastValueProperty()`
    `Long` | `getLongProperty(SimpleString key)`
    `Long` | `getLongProperty(String key)`
    `int` | `getMemoryEstimate()`
    `long` | `getMessageID()` Returns the messageID.
    `Object` | `getObjectProperty(SimpleString key)`
    `Object` | `getObjectProperty(String key)`
    `default Object` | `getObjectPropertyForFilter(SimpleString key)`
    `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 size
    `org.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.
    `int` | `getRefCount()`
    `SimpleString` | `getReplyTo()`
    `default RoutingType` | `getRoutingType()`
    `Long` | `getScheduledDeliveryTime()` Used to calculate what is the delivery time.
    `Short` | `getShortProperty(SimpleString key)`
    `Short` | `getShortProperty(String key)`
    `SimpleString` | `getSimpleStringProperty(SimpleString key)`
    `SimpleString` | `getSimpleStringProperty(String key)`
    `default String` | `getStringBody()`
    `String` | `getStringProperty(SimpleString key)`
    `String` | `getStringProperty(String key)`
    `long` | `getTimestamp()`
    `default byte` | `getType()` Deprecated. do not use this, use through ICoreMessage or ClientMessage
    `int` | `getUsage()`
    `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()`
    `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(SimpleString key, boolean value)`
    `Message` | `putBooleanProperty(String key, boolean value)`
    `Message` | `putByteProperty(SimpleString key, byte value)`
    `Message` | `putByteProperty(String key, byte value)`
    `Message` | `putBytesProperty(SimpleString key, byte[] value)`
    `Message` | `putBytesProperty(String key, byte[] value)`
    `Message` | `putCharProperty(SimpleString key, char value)`
    `Message` | `putCharProperty(String key, char value)`
    `Message` | `putDoubleProperty(SimpleString key, double value)`
    `Message` | `putDoubleProperty(String key, double value)`
    `default Message` | `putExtraBytesProperty(SimpleString key, byte[] value)`
    `Message` | `putFloatProperty(SimpleString key, float value)`
    `Message` | `putFloatProperty(String key, float value)`
    `Message` | `putIntProperty(SimpleString key, int value)`
    `Message` | `putIntProperty(String key, int value)`
    `Message` | `putLongProperty(SimpleString key, long value)`
    `Message` | `putLongProperty(String key, long value)`
    `Message` | `putObjectProperty(SimpleString key, Object value)`
    `Message` | `putObjectProperty(String key, Object value)`
    `Message` | `putShortProperty(SimpleString key, short value)`
    `Message` | `putShortProperty(String key, short value)`
    `Message` | `putStringProperty(SimpleString key, SimpleString value)`
    `Message` | `putStringProperty(SimpleString key, String value)`
    `Message` | `putStringProperty(String key, String value)` Puts a String property in this message.
    `void` | `receiveBuffer(io.netty.buffer.ByteBuf buffer)` Used to receive this message from an encoded medium buffer
    `default void` | `reencode()`
    `int` | `refDown()`
    `default void` | `referenceOriginalMessage(Message original, String 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(SimpleString key)`
    `Object` | `removeProperty(String key)`
    `void` | `sendBuffer(io.netty.buffer.ByteBuf buffer, int deliveryCount)` Used to send this message to an encoded medium buffer.
    `Message` | `setAddress(SimpleString address)` This will set the address on CoreMessage.
    `Message` | `setAddress(String address)` Look at `setAddress(SimpleString)` for the doc.
    `default Message` | `setAnnotation(SimpleString key, Object value)` Callers must call `reencode()` in order to be sent to clients
    `default 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(SimpleString groupID)`
    `default Message` | `setGroupID(String groupID)`
    `default Message` | `setGroupSequence(int sequence)`
    `default Message` | `setIngressTimestamp()`
    `default Message` | `setLastValueProperty(SimpleString lastValueName)`
    `Message` | `setMessageID(long id)`
    `void` | `setOwner(Object object)`
    `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 ClientMessage
    `Message` | `setUserID(Object userID)`
    `default Message` | `setValidatedUserID(String validatedUserID)`
    `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

    - #### 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.

    - #### setScheduledDeliveryTime

          default Message setScheduledDeliveryTime(Long time)

    - #### getGroupID

          default SimpleString getGroupID()

    - #### setGroupID

          default Message setGroupID(SimpleString groupID)

    - #### setGroupID

          default Message setGroupID(String groupID)

    - #### getGroupSequence

          default int getGroupSequence()

    - #### setGroupSequence

          default Message setGroupSequence(int sequence)

    - #### getCorrelationID

          default Object getCorrelationID()

    - #### setCorrelationID

          default Message setCorrelationID(Object correlationID)

    - #### 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.

    - #### setConnectionID

          default Message setConnectionID(String connectionID)

    - #### 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

    - #### setUserID

          Message setUserID(Object userID)

    - #### getValidatedUserID

          default String getValidatedUserID()

    - #### setValidatedUserID

          default Message setValidatedUserID(String validatedUserID)

    - #### 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 at `setAddress(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,
                                                String 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

      Throws:
        `ActiveMQPropertyConversionException`

    - #### removeExtraBytesProperty

          default byte[] removeExtraBytesProperty(SimpleString key)
                                           throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getDuplicateProperty

          default Object getDuplicateProperty()

    - #### putBooleanProperty

          Message putBooleanProperty(String key,
                                     boolean value)

    - #### putByteProperty

          Message putByteProperty(String key,
                                  byte value)

    - #### putBytesProperty

          Message putBytesProperty(String key,
                                   byte[] value)

    - #### putShortProperty

          Message putShortProperty(String key,
                                   short value)

    - #### putCharProperty

          Message putCharProperty(String key,
                                  char value)

    - #### putIntProperty

          Message putIntProperty(String key,
                                 int value)

    - #### putLongProperty

          Message putLongProperty(String key,
                                  long value)

    - #### putFloatProperty

          Message putFloatProperty(String key,
                                   float value)

    - #### putDoubleProperty

          Message putDoubleProperty(String key,
                                    double value)

    - #### 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 name
        `value` - property value

    - #### putObjectProperty

          Message putObjectProperty(String key,
                                    Object value)
                             throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### putObjectProperty

          Message putObjectProperty(SimpleString key,
                                    Object value)
                             throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### removeProperty

          Object removeProperty(String key)

    - #### containsProperty

          boolean containsProperty(String key)

    - #### getBooleanProperty

          Boolean getBooleanProperty(String key)
                              throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getByteProperty

          Byte getByteProperty(String key)
                        throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getDoubleProperty

          Double getDoubleProperty(String key)
                            throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getIntProperty

          Integer getIntProperty(String key)
                          throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getLongProperty

          Long getLongProperty(String key)
                        throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getObjectProperty

          Object getObjectProperty(String key)

    - #### getShortProperty

          Short getShortProperty(String key)
                          throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getFloatProperty

          Float getFloatProperty(String key)
                          throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getStringProperty

          String getStringProperty(String key)
                            throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getSimpleStringProperty

          SimpleString getSimpleStringProperty(String key)
                                        throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getBytesProperty

          byte[] getBytesProperty(String key)
                           throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### removeProperty

          Object removeProperty(SimpleString key)

    - #### containsProperty

          boolean containsProperty(SimpleString key)

    - #### getBooleanProperty

          Boolean getBooleanProperty(SimpleString key)
                              throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getByteProperty

          Byte getByteProperty(SimpleString key)
                        throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getDoubleProperty

          Double getDoubleProperty(SimpleString key)
                            throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getIntProperty

          Integer getIntProperty(SimpleString key)
                          throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getLongProperty

          Long getLongProperty(SimpleString key)
                        throws ActiveMQPropertyConversionException

      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 call `reencode()` 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

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getFloatProperty

          Float getFloatProperty(SimpleString key)
                          throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getStringProperty

          String getStringProperty(SimpleString key)
                            throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getSimpleStringProperty

          SimpleString getSimpleStringProperty(SimpleString key)
                                        throws ActiveMQPropertyConversionException

      Throws:
        `ActiveMQPropertyConversionException`

    - #### getBytesProperty

          byte[] getBytesProperty(SimpleString key)
                           throws ActiveMQPropertyConversionException

      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.

    - #### 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 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()

Copyright © 2021 The Apache Software Foundation. All rights reserved.