Class AMQPMessageSupport


  • public final class AMQPMessageSupport
    extends Object
    Support class containing constant values and static methods that are used to map to / from AMQP Message types being sent or received.
    • Field Detail

      • MESSAGE_DEFAULT_TIME_TO_LIVE

        public static final long MESSAGE_DEFAULT_TIME_TO_LIVE
        See Also:
        Constant Field Values
      • MESSAGE_DEFAULT_PRIORITY

        public static final int MESSAGE_DEFAULT_PRIORITY
        See Also:
        Constant Field Values
      • HDR_ORIGINAL_ADDRESS_ANNOTATION

        public static SimpleString HDR_ORIGINAL_ADDRESS_ANNOTATION
      • JMS_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME

        public static final String JMS_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME
        See Also:
        Constant Field Values
      • JMS_MSG_TYPE

        public static final org.apache.qpid.proton.amqp.Symbol JMS_MSG_TYPE
        Attribute used to mark the class type of JMS message that a particular message instance represents, used internally by the client.
      • JMS_DELIVERY_TIME

        @Deprecated
        public static final org.apache.qpid.proton.amqp.Symbol JMS_DELIVERY_TIME
        Deprecated.
        Use the SCHEDULED_DELIVERY_TIME value as this is not JMS specific and will be removed.
        Attribute used to mark the Application defined delivery time assigned to the message
      • SCHEDULED_DELIVERY_TIME

        public static final org.apache.qpid.proton.amqp.Symbol SCHEDULED_DELIVERY_TIME
        Attribute used to mark the Application defined delivery time assigned to the message
      • SCHEDULED_DELIVERY_DELAY

        public static final org.apache.qpid.proton.amqp.Symbol SCHEDULED_DELIVERY_DELAY
        Attribute used to mark the Application defined delivery time assigned to the message
      • ROUTING_TYPE

        public static final org.apache.qpid.proton.amqp.Symbol ROUTING_TYPE
        Attribute used to mark the Application defined delivery time assigned to the message
      • JMS_MESSAGE

        public static final byte JMS_MESSAGE
        Value mapping for JMS_MSG_TYPE which indicates the message is a generic JMS Message which has no body.
        See Also:
        Constant Field Values
      • JMS_OBJECT_MESSAGE

        public static final byte JMS_OBJECT_MESSAGE
        Value mapping for JMS_MSG_TYPE which indicates the message is a JMS ObjectMessage which has an Object value serialized in its message body.
        See Also:
        Constant Field Values
      • JMS_MAP_MESSAGE

        public static final byte JMS_MAP_MESSAGE
        Value mapping for JMS_MSG_TYPE which indicates the message is a JMS MapMessage which has an Map instance serialized in its message body.
        See Also:
        Constant Field Values
      • JMS_BYTES_MESSAGE

        public static final byte JMS_BYTES_MESSAGE
        Value mapping for JMS_MSG_TYPE which indicates the message is a JMS BytesMessage which has a body that consists of raw bytes.
        See Also:
        Constant Field Values
      • JMS_STREAM_MESSAGE

        public static final byte JMS_STREAM_MESSAGE
        Value mapping for JMS_MSG_TYPE which indicates the message is a JMS StreamMessage which has a body that is a structured collection of primitives values.
        See Also:
        Constant Field Values
      • JMS_TEXT_MESSAGE

        public static final byte JMS_TEXT_MESSAGE
        Value mapping for JMS_MSG_TYPE which indicates the message is a JMS TextMessage which has a body that contains a UTF-8 encoded String.
        See Also:
        Constant Field Values
      • SERIALIZED_JAVA_OBJECT_CONTENT_TYPE

        public static final org.apache.qpid.proton.amqp.Symbol SERIALIZED_JAVA_OBJECT_CONTENT_TYPE
        Content type used to mark Data sections as containing a serialized java object.
      • JMS_AMQP_PREFIX_LENGTH

        public static final int JMS_AMQP_PREFIX_LENGTH
      • JMS_AMQP_ENCODED_DELIVERY_ANNOTATION_PREFIX

        public static final String JMS_AMQP_ENCODED_DELIVERY_ANNOTATION_PREFIX
        See Also:
        Constant Field Values
      • JMS_AMQP_ENCODED_MESSAGE_ANNOTATION_PREFIX

        public static final String JMS_AMQP_ENCODED_MESSAGE_ANNOTATION_PREFIX
        See Also:
        Constant Field Values
      • EMPTY_BINARY

        public static final org.apache.qpid.proton.amqp.Binary EMPTY_BINARY
      • EMPTY_BODY

        public static final org.apache.qpid.proton.amqp.messaging.Data EMPTY_BODY
      • JMS_DEST_TYPE_MSG_ANNOTATION

        public static final org.apache.qpid.proton.amqp.Symbol JMS_DEST_TYPE_MSG_ANNOTATION
      • JMS_REPLY_TO_TYPE_MSG_ANNOTATION

        public static final org.apache.qpid.proton.amqp.Symbol JMS_REPLY_TO_TYPE_MSG_ANNOTATION
      • INGRESS_TIME_MSG_ANNOTATION

        public static final org.apache.qpid.proton.amqp.Symbol INGRESS_TIME_MSG_ANNOTATION
      • OCTET_STREAM_CONTENT_TYPE_SYMBOL

        public static final org.apache.qpid.proton.amqp.Symbol OCTET_STREAM_CONTENT_TYPE_SYMBOL
        Content type used to mark Data sections as containing arbitrary bytes.
    • Constructor Detail

      • AMQPMessageSupport

        public AMQPMessageSupport()
    • Method Detail

      • getSymbol

        public static org.apache.qpid.proton.amqp.Symbol getSymbol​(String key)
        Lookup and return the correct Proton Symbol instance based on the given key.
        Parameters:
        key - the String value name of the Symbol to locate.
        Returns:
        the Symbol value that matches the given key.
      • getMessageAnnotation

        public static Object getMessageAnnotation​(String key,
                                                  org.apache.qpid.proton.message.Message message)
        Safe way to access message annotations which will check internal structure and either return the annotation if it exists or null if the annotation or any annotations are present.
        Parameters:
        key - the String key to use to lookup an annotation.
        message - the AMQP message object that is being examined.
        Returns:
        the given annotation value or null if not present in the message.
      • isContentType

        public static boolean isContentType​(String contentType,
                                            org.apache.qpid.proton.message.Message message)
        Check whether the content-type field of the properties section (if present) in the given message matches the provided string (where null matches if there is no content type present.
        Parameters:
        contentType - content type string to compare against, or null if none
        message - the AMQP message object that is being examined.
        Returns:
        true if content type matches
      • isContentType

        public static boolean isContentType​(String expected,
                                            org.apache.qpid.proton.amqp.Symbol actual)
        Check whether the content-type given matches the expect value.
        Parameters:
        expected - content type string to compare against or null if not expected to be set
        actual - the AMQP content type symbol from the Properties section
        Returns:
        true if content type matches
      • getCharsetForTextualContent

        public static Charset getCharsetForTextualContent​(String contentType)
        Parameters:
        contentType - the contentType of the received message
        Returns:
        the character set to use, or null if not to treat the message as text
      • toAnnotationName

        public static String toAnnotationName​(String key)
      • toAddress

        public static String toAddress​(String destination)
      • destinationType

        public static byte destinationType​(String destination)