Java Reference
In-Depth Information
up by explicitly calling the
JMSContext.close()
method or else take advantage of
the
AutoCloseable
interface introduced with Java SE 7.
If all goes well, a message containing the shipping request ends up in the queue. Before
we look at the message consumer code that receives this message, let's discuss the
javax.jms.Message
object in a little more detail.
4.2.1. JMS Message interface
The
Message
interface standardizes the different types of messages that can be exchanged
across different JMS providers. As
figure 4.6
shows, a JMS message has the following
parts: the message header, the message properties, and the message body, each of which is
detailed in the following sections.
Figure 4.6. Anatomy of a JMS message