Explain the use of Message object.- Message Object is a light weight entity that comprises of only header and properties.
- It does not comprise of payload. Thus, no data needs to be transferred when the receivers just need to be notified.
- Due to this using message becomes a very efficient way.
- It contains a built-in facility for supporting application-defined property values.
- In effect, this provides a mechanism for adding application-specific header fields to a message.
- Properties allow an application, via message selectors, to have a JMS provider select, or filter, messages on its behalf using application-specific criteria.
- Property names must obey the rules for a message selector identifier.
- Property names must not be null, and must not be empty strings.
- If a property name is set and it is either null or an empty string, an IllegalArgumentException must be thrown.
- Property values are set prior to sending a message.
- When a client receives a message, its properties are in read-only mode.
|