What are JMS messages?
Location: http://www.jguru.com/faq/view.jsp?EID=792 Created: Nov 10, 1999 Modified: 1999-11-29 16:57:34.155 Author: Jerry Smith (http://www.jguru.com/guru/viewbio.jsp?EID=9) JMS messages implement the Message interface. JMS messages include a header, properties, and the message body. Headers provide identifying and routing information. Properties allow arbitrary ornamenting of messages with application-specific markers or tags. Receiving clients can select, or filter, messages based on properties. The message body is available in five flavors: • StreamMessage – a stream of Java primitive values • MapMessage – a set of name-value pairs • TextMessage – a String object • ObjectMessage – a serialzed Java object • BytesMessage – a stream of uninterpreted bytes To obtain a message of the requisite type, make a request via the appropriate create method, for example: TextMessage message = session.createTextMessage(); Note that some vendors provide additional message types.