Messages are the backbone of a messaging system. A messages is a self-contained autonomous entity that may be resent several times across many clients (and processes) throughout its life span. Each consumer along a message's route will examine it and, depending on its contents (both payload and headers), may execute some business logic, modify it, or create new messages to accomplish a communicated task.
As shown in Anatomy of a JMS message, a JMS message consists of three components: headers, properties, and body.
The body component contains the payload, which can be textual or binary data, as
specified by using one of the six supported Java message types: Message,
TextMessage, MapMessage, BytesMessage,
StreamMessage, and ObjectMessage.
Header and property components transmit metadata used by clients and by the broker. All of the complexity of JMS messages resides in these two components, which are logically the same, but differ in their semantics.
Headers
The JMS API provides a standard list of JMS headers (identified by the
JMSprefix) and methods to work with them. The producer'ssend()method automatically assigns a number of these headers to messages, while others are optionally set either by the producer or by the broker.Properties
Client applications can create used-defined properties based on Java primitive types. The JMS API also provides generic methods for working with these user-defined properties.
Two other types of properties, JMS-defined properties (identified by
JMSXprefix) are reserved by the JMS specification, and the vendor-specific properties (identified by theJMSActiveMQBrokerprefix) are reserved by the broker.
For a list of supported headers and properties, see ActiveMQ in Action (Snyder, Bosanac, and Davies)









