Summary
We began our exploration of the JMS message by examining the concepts and considerations associated with defining messages. We discussed how message content is defined and reviewed three popular physical formats used to structure message content: XML, tagged/delimited, and record-oriented. Physical formats enable the application to make sense of the data, and for each format we reviewed its history and detailed how it could be used by the JMS client.
We then examined the structure of the JMS message and detailed the attributes that comprise the header, properties, and body. We considered how some of these attributes could be used to effect application processing and specifically devoted some time to examining the use of message selectors to control which messages are delivered to the JMS client. We also discussed which types of JMS messages are suited to various enterprise messaging scenarios, concluding that TextMessage and BytesMessage are the most flexible and versatile.
The chapter concluded with a detailed review of the accessor methods defined by each type of message interface, and using code snippets, we demonstrated how a JMS client creates, packs, or unpacks a BytesMessage, TextMessage, StreamMessage, MapMessage, and ObjectMessage.
In the following chapter we examine how our JMS message can be sent or received using the JMS API.