Class AmqpMessageSupport
java.lang.Object
org.apache.activemq.transport.amqp.message.AmqpMessageSupport
Support class containing constant values and static methods that are
used to map to / from AMQP Message types being sent or received.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final Stringstatic final Stringstatic final Stringstatic final org.apache.qpid.proton.amqp.Binarystatic final org.apache.qpid.proton.amqp.messaging.Datastatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final org.apache.qpid.proton.amqp.messaging.Datastatic final StringContent type used to mark Data sections as containing arbitrary bytes.static final Stringstatic final Stringstatic final Stringstatic final StringContent type used to mark Data sections as containing a serialized java object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.qpid.proton.amqp.BinarygetBinaryFromMessageBody(org.apache.activemq.command.ActiveMQBytesMessage message) Return the encoded form of the BytesMessage as an AMQP Binary instance.static org.apache.qpid.proton.amqp.BinarygetBinaryFromMessageBody(org.apache.activemq.command.ActiveMQObjectMessage message) Return the encoded form of the BytesMessage as an AMQP Binary instance.static org.apache.qpid.proton.amqp.BinarygetBinaryFromMessageBody(org.apache.activemq.command.ActiveMQTextMessage message) Return the encoded form of the Message as an AMQP Binary instance.static CharsetgetCharsetForTextualContent(String contentType) getMapFromMessageBody(org.apache.activemq.command.ActiveMQMapMessage message) Return the underlying Map from the JMS MapMessage instance.static ObjectgetMessageAnnotation(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.static org.apache.qpid.proton.amqp.SymbolLookup and return the correct Proton Symbol instance based on the given key.static booleanisContentType(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.
-
Field Details
-
JMS_AMQP_PREFIX
- See Also:
-
JMS_AMQP_PREFIX_LENGTH
public static final int JMS_AMQP_PREFIX_LENGTH -
MESSAGE_FORMAT
- See Also:
-
ORIGINAL_ENCODING
- See Also:
-
NATIVE
- See Also:
-
HEADER
- See Also:
-
PROPERTIES
- See Also:
-
FIRST_ACQUIRER
- See Also:
-
CONTENT_TYPE
- See Also:
-
CONTENT_ENCODING
- See Also:
-
REPLYTO_GROUP_ID
- See Also:
-
DELIVERY_ANNOTATION_PREFIX
- See Also:
-
MESSAGE_ANNOTATION_PREFIX
- See Also:
-
FOOTER_PREFIX
- See Also:
-
JMS_AMQP_HEADER
- See Also:
-
JMS_AMQP_PROPERTIES
- See Also:
-
JMS_AMQP_ORIGINAL_ENCODING
- See Also:
-
JMS_AMQP_MESSAGE_FORMAT
- See Also:
-
JMS_AMQP_NATIVE
- See Also:
-
JMS_AMQP_FIRST_ACQUIRER
- See Also:
-
JMS_AMQP_CONTENT_TYPE
- See Also:
-
JMS_AMQP_CONTENT_ENCODING
- See Also:
-
JMS_AMQP_REPLYTO_GROUP_ID
- See Also:
-
JMS_AMQP_DELIVERY_ANNOTATION_PREFIX
- See Also:
-
JMS_AMQP_MESSAGE_ANNOTATION_PREFIX
- See Also:
-
JMS_AMQP_FOOTER_PREFIX
- See Also:
-
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 -
NULL_OBJECT_BODY
public static final org.apache.qpid.proton.amqp.messaging.Data NULL_OBJECT_BODY -
AMQP_UNKNOWN
public static final short AMQP_UNKNOWN- See Also:
-
AMQP_NULL
public static final short AMQP_NULL- See Also:
-
AMQP_DATA
public static final short AMQP_DATA- See Also:
-
AMQP_SEQUENCE
public static final short AMQP_SEQUENCE- See Also:
-
AMQP_VALUE_NULL
public static final short AMQP_VALUE_NULL- See Also:
-
AMQP_VALUE_STRING
public static final short AMQP_VALUE_STRING- See Also:
-
AMQP_VALUE_BINARY
public static final short AMQP_VALUE_BINARY- See Also:
-
AMQP_VALUE_MAP
public static final short AMQP_VALUE_MAP- See Also:
-
AMQP_VALUE_LIST
public static final short AMQP_VALUE_LIST- See Also:
-
SERIALIZED_JAVA_OBJECT_CONTENT_TYPE
Content type used to mark Data sections as containing a serialized java object.- See Also:
-
OCTET_STREAM_CONTENT_TYPE
Content type used to mark Data sections as containing arbitrary bytes.- See Also:
-
-
Constructor Details
-
AmqpMessageSupport
public AmqpMessageSupport()
-
-
Method Details
-
getSymbol
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 nonemessage- the AMQP message object that is being examined.- Returns:
- true if content type matches
-
getCharsetForTextualContent
- Parameters:
contentType- the contentType of the received message- Returns:
- the character set to use, or null if not to treat the message as text
-
getBinaryFromMessageBody
public static org.apache.qpid.proton.amqp.Binary getBinaryFromMessageBody(org.apache.activemq.command.ActiveMQBytesMessage message) throws jakarta.jms.JMSException Return the encoded form of the BytesMessage as an AMQP Binary instance.- Parameters:
message- the Message whose binary encoded body is needed.- Returns:
- a Binary instance containing the encoded message body.
- Throws:
jakarta.jms.JMSException- if an error occurs while fetching the binary payload.
-
getBinaryFromMessageBody
public static org.apache.qpid.proton.amqp.Binary getBinaryFromMessageBody(org.apache.activemq.command.ActiveMQObjectMessage message) throws jakarta.jms.JMSException Return the encoded form of the BytesMessage as an AMQP Binary instance.- Parameters:
message- the Message whose binary encoded body is needed.- Returns:
- a Binary instance containing the encoded message body.
- Throws:
jakarta.jms.JMSException- if an error occurs while fetching the binary payload.
-
getBinaryFromMessageBody
public static org.apache.qpid.proton.amqp.Binary getBinaryFromMessageBody(org.apache.activemq.command.ActiveMQTextMessage message) throws jakarta.jms.JMSException Return the encoded form of the Message as an AMQP Binary instance.- Parameters:
message- the Message whose binary encoded body is needed.- Returns:
- a Binary instance containing the encoded message body.
- Throws:
jakarta.jms.JMSException- if an error occurs while fetching the binary payload.
-
getMapFromMessageBody
public static Map<String,Object> getMapFromMessageBody(org.apache.activemq.command.ActiveMQMapMessage message) throws jakarta.jms.JMSException Return the underlying Map from the JMS MapMessage instance.- Parameters:
message- the MapMessage whose underlying Map is requested.- Returns:
- the underlying Map used to store the value in the given MapMessage.
- Throws:
jakarta.jms.JMSException- if an error occurs in constructing or fetching the Map.
-