Class AmqpMessageSupport
java.lang.Object
org.apache.qpid.jms.provider.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 Stringstatic final Stringstatic final Stringstatic final byteValue mapping for JMS_MSG_TYPE which indicates the message is a JMS BytesMessage which has a body that consists of raw bytes.static final org.apache.qpid.proton.amqp.SymbolAttribute used to mark the Application defined delivery time assigned to the messagestatic final byteValue mapping for JMS_MSG_TYPE which indicates the message is a JMS MapMessage which has an Map instance serialized in its message body.static final byteValue mapping for JMS_MSG_TYPE which indicates the message is a generic JMS Message which has no body.static final org.apache.qpid.proton.amqp.SymbolAttribute used to mark the class type of JMS message that a particular message instance represents, used internally by the client.static final byteValue mapping for JMS_MSG_TYPE which indicates the message is a JMS ObjectMessage which has an Object value serialized in its message body.static final byteValue 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.static final byteValue mapping for JMS_MSG_TYPE which indicates the message is a JMS TextMessage which has a body that contains a UTF-8 encoded String.static final Stringstatic final org.apache.qpid.proton.amqp.Symbolstatic final Stringstatic final org.apache.qpid.proton.amqp.Symbolstatic final Stringstatic final org.apache.qpid.proton.amqp.SymbolContent type used to mark Data sections as containing arbitrary bytes.static final org.apache.qpid.proton.amqp.SymbolContent type used to mark Data sections as containing a serialized java object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.qpid.proton.message.MessagedecodeMessage(io.netty.buffer.ByteBuf encodedBytes) Given a byte buffer that represents an encoded AMQP Message instance, decode and return the Message.static org.apache.qpid.proton.codec.ReadableBufferencodeMessage(org.apache.qpid.proton.message.Message message) Given a Message instance, encode the Message to the wire level representation of that Message.static ObjectgetMessageAnnotation(org.apache.qpid.proton.amqp.Symbol key, org.apache.qpid.proton.amqp.messaging.MessageAnnotations messageAnnotations) 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 booleanisContentType(org.apache.qpid.proton.amqp.Symbol contentType, org.apache.qpid.proton.amqp.Symbol messageContentType) 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_MSG_TYPE
public static final org.apache.qpid.proton.amqp.Symbol JMS_MSG_TYPEAttribute used to mark the class type of JMS message that a particular message instance represents, used internally by the client. -
JMS_DELIVERY_TIME
public static final org.apache.qpid.proton.amqp.Symbol JMS_DELIVERY_TIMEAttribute used to mark the Application defined delivery time assigned to the message -
JMS_MESSAGE
public static final byte JMS_MESSAGEValue mapping for JMS_MSG_TYPE which indicates the message is a generic JMS Message which has no body.- See Also:
-
JMS_OBJECT_MESSAGE
public static final byte JMS_OBJECT_MESSAGEValue 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:
-
JMS_MAP_MESSAGE
public static final byte JMS_MAP_MESSAGEValue 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:
-
JMS_BYTES_MESSAGE
public static final byte JMS_BYTES_MESSAGEValue mapping for JMS_MSG_TYPE which indicates the message is a JMS BytesMessage which has a body that consists of raw bytes.- See Also:
-
JMS_STREAM_MESSAGE
public static final byte JMS_STREAM_MESSAGEValue 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:
-
JMS_TEXT_MESSAGE
public static final byte JMS_TEXT_MESSAGEValue 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:
-
JMS_AMQP_TTL
- See Also:
-
JMS_AMQP_REPLY_TO_GROUP_ID
- See Also:
-
JMS_AMQP_TYPED_ENCODING
- See Also:
-
SERIALIZED_JAVA_OBJECT_CONTENT_TYPE
public static final org.apache.qpid.proton.amqp.Symbol SERIALIZED_JAVA_OBJECT_CONTENT_TYPEContent type used to mark Data sections as containing a serialized java object. -
OCTET_STREAM_CONTENT_TYPE
public static final org.apache.qpid.proton.amqp.Symbol OCTET_STREAM_CONTENT_TYPEContent type used to mark Data sections as containing arbitrary bytes. -
LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL
public static final org.apache.qpid.proton.amqp.Symbol LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL -
LEGACY_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL
public static final org.apache.qpid.proton.amqp.Symbol LEGACY_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL -
LEGACY_QUEUE_ATTRIBUTE
- See Also:
-
LEGACY_TOPIC_ATTRIBUTE
- See Also:
-
LEGACY_TEMPORARY_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
AmqpMessageSupport
public AmqpMessageSupport()
-
-
Method Details
-
getMessageAnnotation
public static Object getMessageAnnotation(org.apache.qpid.proton.amqp.Symbol key, org.apache.qpid.proton.amqp.messaging.MessageAnnotations messageAnnotations) 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 Symbol key to use to lookup an annotation.messageAnnotations- the AMQP message annotations object that is being examined.- Returns:
- the given annotation value or null if not present in the message.
-
isContentType
public static boolean isContentType(org.apache.qpid.proton.amqp.Symbol contentType, org.apache.qpid.proton.amqp.Symbol messageContentType) 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 nonemessageContentType- the content type value read from an AMQP message object.- Returns:
- true if content type matches
-
decodeMessage
public static org.apache.qpid.proton.message.Message decodeMessage(io.netty.buffer.ByteBuf encodedBytes) Given a byte buffer that represents an encoded AMQP Message instance, decode and return the Message.- Parameters:
encodedBytes- the bytes that represent an encoded AMQP Message.- Returns:
- a new Message instance with the decoded data.
-
encodeMessage
public static org.apache.qpid.proton.codec.ReadableBuffer encodeMessage(org.apache.qpid.proton.message.Message message) Given a Message instance, encode the Message to the wire level representation of that Message.- Parameters:
message- the Message that is to be encoded into the wire level representation.- Returns:
- a buffer containing the wire level representation of the input Message.
-