XML should be the message type used for most scenarios due to its interoperability and flexibility (see the related focus point). However, if your performance requirements are critical and cannot be satisfied with XML, use one of the JMS native message types recommended below.


The following lists the JMS native message types to consider using when your performance requirements are critical. Also listed is the usage scenario and advantages and disadvantages of using each type. Choose one of these message types to avoid the overhead associated with XML parsing and streaming.

Message Type Use when Message Holds Pros Cons
MapMessageKeyed Java primitive typesLoosely coupled, random access, easily adaptable if data changesJMS specific
StreamMessageUnkeyed Java primitive typesLess memory overhead than MapMessageJMS specific, tightly coupled, sequential access
BytesMessageBinary or uninterpreted bytesControl over size and parsing algorithm leading to optimized programsJMS specific, tightly coupled
ObjectMessageSerializable Java objectsEasy to exchange data between Java applicationsJMS specific, tightly coupled, more memory overhead

Brought to you by Progress Professional Services