Skip to Main Content
Java Message Service
book

Java Message Service

by David A Chappell, Richard Monson-Haefel
December 2000
Intermediate to advanced content levelIntermediate to advanced
240 pages
6h 9m
English
O'Reilly Media, Inc.
Content preview from Java Message Service

Appendix B. Message Headers

The message headers provide metadata describing who or what created the message, when it was created, how long its data is valid, etc. The headers also contain routing information that describes the destination of the message (topic or queue), how a message should be acknowledged, and a lot more.

The Message interface provides mutator (“set”) methods for each of the JMS headers, but only the JMSReplyTo, JMSCorrelationID, and JMSType headers can be modified using these methods. Calls to the mutator methods for any of the other JMS headers will be ignored when the message is sent. According to the authors of the specification, the mutator methods were left in the Message interface for “general orthogonality”; to balance the accessor methods—a fairly strange but well-established justification.

The accessor (“get”) methods always provide the JMS client with information about the JMS headers. However, some JMS headers (i.e., JMSTimestamp, JMSRedelivered, etc.) are not available until after the message is sent or even received.

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.
Start your free trial

You might also like

Mastering Spring Boot 2.0

Mastering Spring Boot 2.0

Dinesh Rajput
Cloud Native Java

Cloud Native Java

Josh Long, Kenny Bastani

Publisher Resources

ISBN: 0596000685Supplemental ContentErrata Page