Class AmqpMessageSupport
- java.lang.Object
-
- org.apache.activemq.transport.amqp.message.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 Summary
-
Constructor Summary
Constructors Constructor Description AmqpMessageSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.qpid.proton.amqp.Binary
getBinaryFromMessageBody(ActiveMQBytesMessage message)
Return the encoded form of the BytesMessage as an AMQP Binary instance.static org.apache.qpid.proton.amqp.Binary
getBinaryFromMessageBody(ActiveMQObjectMessage message)
Return the encoded form of the BytesMessage as an AMQP Binary instance.static org.apache.qpid.proton.amqp.Binary
getBinaryFromMessageBody(ActiveMQTextMessage message)
Return the encoded form of the Message as an AMQP Binary instance.static Charset
getCharsetForTextualContent(String contentType)
static Map<String,Object>
getMapFromMessageBody(ActiveMQMapMessage message)
Return the underlying Map from the JMS MapMessage instance.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.static org.apache.qpid.proton.amqp.Symbol
getSymbol(String key)
Lookup and return the correct Proton Symbol instance based on the given key.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.
-
-
-
Field Detail
-
JMS_AMQP_PREFIX
public static final String JMS_AMQP_PREFIX
- See Also:
- Constant Field Values
-
JMS_AMQP_PREFIX_LENGTH
public static final int JMS_AMQP_PREFIX_LENGTH
-
MESSAGE_FORMAT
public static final String MESSAGE_FORMAT
- See Also:
- Constant Field Values
-
ORIGINAL_ENCODING
public static final String ORIGINAL_ENCODING
- See Also:
- Constant Field Values
-
NATIVE
public static final String NATIVE
- See Also:
- Constant Field Values
-
HEADER
public static final String HEADER
- See Also:
- Constant Field Values
-
PROPERTIES
public static final String PROPERTIES
- See Also:
- Constant Field Values
-
FIRST_ACQUIRER
public static final String FIRST_ACQUIRER
- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final String CONTENT_TYPE
- See Also:
- Constant Field Values
-
CONTENT_ENCODING
public static final String CONTENT_ENCODING
- See Also:
- Constant Field Values
-
REPLYTO_GROUP_ID
public static final String REPLYTO_GROUP_ID
- See Also:
- Constant Field Values
-
DELIVERY_ANNOTATION_PREFIX
public static final String DELIVERY_ANNOTATION_PREFIX
- See Also:
- Constant Field Values
-
MESSAGE_ANNOTATION_PREFIX
public static final String MESSAGE_ANNOTATION_PREFIX
- See Also:
- Constant Field Values
-
FOOTER_PREFIX
public static final String FOOTER_PREFIX
- See Also:
- Constant Field Values
-
JMS_AMQP_HEADER
public static final String JMS_AMQP_HEADER
- See Also:
- Constant Field Values
-
JMS_AMQP_PROPERTIES
public static final String JMS_AMQP_PROPERTIES
- See Also:
- Constant Field Values
-
JMS_AMQP_ORIGINAL_ENCODING
public static final String JMS_AMQP_ORIGINAL_ENCODING
- See Also:
- Constant Field Values
-
JMS_AMQP_MESSAGE_FORMAT
public static final String JMS_AMQP_MESSAGE_FORMAT
- See Also:
- Constant Field Values
-
JMS_AMQP_NATIVE
public static final String JMS_AMQP_NATIVE
- See Also:
- Constant Field Values
-
JMS_AMQP_FIRST_ACQUIRER
public static final String JMS_AMQP_FIRST_ACQUIRER
- See Also:
- Constant Field Values
-
JMS_AMQP_CONTENT_TYPE
public static final String JMS_AMQP_CONTENT_TYPE
- See Also:
- Constant Field Values
-
JMS_AMQP_CONTENT_ENCODING
public static final String JMS_AMQP_CONTENT_ENCODING
- See Also:
- Constant Field Values
-
JMS_AMQP_REPLYTO_GROUP_ID
public static final String JMS_AMQP_REPLYTO_GROUP_ID
- See Also:
- Constant Field Values
-
JMS_AMQP_DELIVERY_ANNOTATION_PREFIX
public static final String JMS_AMQP_DELIVERY_ANNOTATION_PREFIX
- See Also:
- Constant Field Values
-
JMS_AMQP_MESSAGE_ANNOTATION_PREFIX
public static final String JMS_AMQP_MESSAGE_ANNOTATION_PREFIX
- See Also:
- Constant Field Values
-
JMS_AMQP_FOOTER_PREFIX
public static final String JMS_AMQP_FOOTER_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
-
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:
- Constant Field Values
-
AMQP_NULL
public static final short AMQP_NULL
- See Also:
- Constant Field Values
-
AMQP_DATA
public static final short AMQP_DATA
- See Also:
- Constant Field Values
-
AMQP_SEQUENCE
public static final short AMQP_SEQUENCE
- See Also:
- Constant Field Values
-
AMQP_VALUE_NULL
public static final short AMQP_VALUE_NULL
- See Also:
- Constant Field Values
-
AMQP_VALUE_STRING
public static final short AMQP_VALUE_STRING
- See Also:
- Constant Field Values
-
AMQP_VALUE_BINARY
public static final short AMQP_VALUE_BINARY
- See Also:
- Constant Field Values
-
AMQP_VALUE_MAP
public static final short AMQP_VALUE_MAP
- See Also:
- Constant Field Values
-
AMQP_VALUE_LIST
public static final short AMQP_VALUE_LIST
- See Also:
- Constant Field Values
-
SERIALIZED_JAVA_OBJECT_CONTENT_TYPE
public static final String SERIALIZED_JAVA_OBJECT_CONTENT_TYPE
Content type used to mark Data sections as containing a serialized java object.- See Also:
- Constant Field Values
-
OCTET_STREAM_CONTENT_TYPE
public static final String OCTET_STREAM_CONTENT_TYPE
Content type used to mark Data sections as containing arbitrary bytes.- See Also:
- Constant Field Values
-
-
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 nonemessage
- the AMQP message object that is being examined.- 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
-
getBinaryFromMessageBody
public static org.apache.qpid.proton.amqp.Binary getBinaryFromMessageBody(ActiveMQBytesMessage message) throws 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:
JMSException
- if an error occurs while fetching the binary payload.
-
getBinaryFromMessageBody
public static org.apache.qpid.proton.amqp.Binary getBinaryFromMessageBody(ActiveMQObjectMessage message) throws 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:
JMSException
- if an error occurs while fetching the binary payload.
-
getBinaryFromMessageBody
public static org.apache.qpid.proton.amqp.Binary getBinaryFromMessageBody(ActiveMQTextMessage message) throws 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:
JMSException
- if an error occurs while fetching the binary payload.
-
getMapFromMessageBody
public static Map<String,Object> getMapFromMessageBody(ActiveMQMapMessage message) throws 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:
JMSException
- if an error occurs in constructing or fetching the Map.
-
-