24.1. Overview and Related Methods and Interfaces

A MapMessage object is used to send a set of name/value pairs. The names are String objects, and the values are primitive data types in the Java programming language. The entries can be accessed sequentially or randomly by name. The order of the entries is undefined. MapMessage inherits from the Message interface and adds a message body that contains a Map.

The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to MapMessage.setInt("foo", 6) is equivalent to MapMessage.setObject("foo", new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, ...

Get Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.