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 Details

    • memoryOffset

      static final int memoryOffset
      See Also:
    • 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:
    • OBJECT_TYPE

      static final byte OBJECT_TYPE
      See Also:
    • TEXT_TYPE

      static final byte TEXT_TYPE
      See Also:
    • BYTES_TYPE

      static final byte BYTES_TYPE
      See Also:
    • MAP_TYPE

      static final byte MAP_TYPE
      See Also:
    • STREAM_TYPE

      static final byte STREAM_TYPE
      See Also:
    • 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:
    • LARGE_EMBEDDED_TYPE

      static final byte LARGE_EMBEDDED_TYPE
      This is to embedd Large Messages from other protocol
      See Also:
  • Method Details