JMS - Message Components



Description

JMS message communicates with JMS clients by using three JMS components −

  • Message Header
  • Message Properties
  • Message Body

Message Header

The JMS message header includes following fields, which are used by clients and providers to indicate and send messages.

  • JMSDestination
  • JMSDeliveryMode
  • JMSTimestamp
  • JMSMessageID
  • JMSReplyTo
  • JMSCorrelationID
  • JMSReplyTo
  • JMSRedelivered
  • JMSType
  • JMSExpiration
  • JMSPriority

Message Properties

Properties can be created and set for the messages by using the custom name value pairs. The message properties are used with other messaging systems, to create message selectors and for supporting filtering messages.

Message Body

The JMS API provides following message body formats, which are used to send and receive the information in various forms −

  • Text message − It defines the text message by using the javax.jms.TextMessage interface.

  • Object message − It defines the Java object by using the javax.jms.ObjectMessage interface.

  • Bytes message − It specifies the binary data by using the javax.jms.BytesMessage interface.

  • Stream message − It specifies the Java's primitive values (such as int, char, float etc) by using the javax.jms.StreamMessage interface.

  • Map message − It specifies the key/value pair by using the javax.jms.MapMessage interface.

Advertisements