Immutable Properties
Once a message is sent, its properties become read-only; the
properties cannot be changed. While consumers can read the properties
using the property accessor methods (get<TYPE>Property()), they cannot modify
the properties using any of the mutator methods (set<TYPE>Property()). If the consumer
attempts to set a property, the mutator method throws a javax.jms.MessageNotWriteableException.
Once a message is received, the only way its properties can be
changed is by clearing out all the properties using the clearProperties() method. This removes all the
properties from the message so that new ones can be added. Individual
properties cannot be modified or removed once a message is sent.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access