JMS Message

1)recap

     The Message interface is the root interface of all JMS messages. It defines the message header and the acknowledge method used for all messages.

     Most message-oriented middleware (MOM) products treat messages as lightweight entities that consist of a header and a payload. The header contains fields used for message routing and identification; the payload contains the application data being sent.

    Within this general form, the definition of a message varies significantly across products. It would be quite difficult for the JMS API to support all of these message models.

With this in mind, the JMS message model has the following goals:

  • Provide a single, unified message API
  • Provide an API suitable for creating messages that match the format used by provider-native messaging applications
  • Support the development of heterogeneous applications that span operating systems, machine architectures, and computer languages
  • Support messages containing objects in the Java programming language ("Java objects")
  • Support messages containing Extensible Markup Language (XML) pages

JMS messages are composed of the following parts:

  • Header - All messages support the same set of header fields. Header fields contain values used by both clients and providers to identify and route messages.
  • Properties - Each message contains a built-in facility for supporting application-defined property values. Properties provide an efficient mechanism for supporting application-defined message filtering.
  • Body - The JMS API defines several types of message body, which cover the majority of messaging styles currently in use.

2) Message Header

     The JMSCorrelationID header field is used for linking one message with another. It typically links a reply message with its requesting message.

JMSCorrelationID can hold a provider-specific message ID, an application-specific String object, or a provider-native byte[] value.

 

3)Message Properties

 

 

你可能感兴趣的:(message)