11.3 Choosing what format to use within JMS messages

 

+

Search Tips   |   Advanced Search

 

The choice of physical format within a JMS message is a key decision in architecting a messaging solution. In small messaging applications, using the various JMS message types...

...can be sufficient. It is often the case in enterprise solutions for a javax.jms.BytesMessage or javax.jms.TextMessage to be used in addition to physical formatting in order to facilitate more complex data structures.

The effect of an efficient physical format is not vital for performance; however, small gains can be achieved with efficient and effective message representation. The subject is covered here for completeness.

The size of a message body is also a performance consideration. A modest gain in performance may be gained from reducing the size of a heavily used JMS message in an application. In general, a series of small messages each with a specific purpose can perform better then a single verbose message. JMS 1.1 added BytesMessage.getBodyLength() which may prove useful in logging message payloads.

The following physical formats are the most common:

For a complete discussion of message formatting see the book Enterprise Messaging Using JMS and IBM WebSphere by Kareem Yusuf, Ph.D.. An excerpt on physical message formatting is available online at:

http://www.htmltr.com/articles/article.asp?p=170722

Next