Amazon

Tuesday, September 20, 2016

JMS Message Structure

The basic structure of a JMS message consists out of three parts: headers,properties and body

JMS Message Headers
Header Field Set By Description
JMSDestination send or publish method Returns a Destination object (a Topic or a Queue, or their temporary version) describing where the message was directed.
JMSDeliveryMode send or publish method Can be DeliveryMode.NON_PERSISTENT orDeliveryMode.PERSISTENT; only persistent messages guarantee delivery in case of a crash of the brokers that transport it.
JMSExpiration send or publish method Returns a timestamp indicating the expiration time of the message; it can be 0 on a message without a defined expiration.
JMSPriority send or publish method Returns a 0-9 integer value (higher is better) defining the priority for delivery. It is only a best-effort value.
JMSMessageID send or publish method Contains a generated ID for identifying a message, unique at least for the current broker. All generated IDs start with the prefix 'ID:', but you can override it with the corresponding setter.
JMSTimestamp send or publish method Returns a long indicating the time of sending.
JMSCorrelationID Client Can link a message with another, usually one that has been sent previously (typically used for a request/response scenario). For example, a reply can carry the ID of the original request message.
JMSReplyTo Client Is a Destination object where replies should be sent, it can be null.
JMSType Client Defines a field for provider-specific or application-specific message types.
JMSRedelivered JMS provider Returns a boolean indicating if the message is being delivered again after a delivery which was not acknowledge.


JMS Message Properties
Application-related properties A Java application can assign application-related properties, which are set before the message is delivered.
Provider-related properties Every JMS provider can define proprietary properties that can be set either by the client or automatically by the provider. Provider-related properties are prefixed with 'JMS_' followed by the vendor name and the specific property name; for example: JMS_I
Standard properties These standardized properties are set by the JMS provider (if supported) when a message is sent. Standard property names start with 'JMSX'; for example: JMSXUserid or JMSXDeliveryCount.


JMS Message Body
Message Type Body Contains
TextMessage A java.lang.String object (for example, the contents of an XML file).
MapMessage A set of name-value pairs, with names as String objects and values as primitive types in the Java programming language. The entries can be accessed sequentially by enumerator or randomly by name. The order of the entries is undefined.
BytesMessage A stream of uninterpreted bytes. This message type is for literally encoding a body to match an existing message format.
StreamMessage A stream of primitive values in the Java programming language, filled and read sequentially.
ObjectMessage A Serializable object in the Java programming language.

No comments:

Post a Comment

Amazon Best Sellors

TOGAF 9.2 - STUDY [ The Open Group Architecture Framework ] - Chap 01 - Introduction

100 Feet View of TOGAF  What is Enterprise? Collection of Organization that has common set of Goals. Enterprise has People - organized by co...