Class MessageHeader

java.lang.Object
io.micronaut.jms.model.MessageHeader

public class MessageHeader extends Object
Represents a header on a JMS message. Used in the JmsProducer and the JMS implementation for MessageHeader.
Since:
1.0.0
Author:
Elliott Pope
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a container for the message header.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(javax.jms.Message message)
    If this is a supported JMS header, attempts to set the header given by the key with the value given with value, doing all required type conversions.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MessageHeader

      public MessageHeader(String key, Object value)
      Creates a container for the message header.
      Parameters:
      key - the header name
      value - the header value
  • Method Details

    • apply

      public void apply(javax.jms.Message message)
      If this is a supported JMS header, attempts to set the header given by the key with the value given with value, doing all required type conversions. Not all JMS headers are supported since most are set by the JMS provider (e.g. JMSHeaders.JMS_PRIORITY). If the header isn't a JMS header, sets an object property. This is only supported for Strings and objectified primitive object types (Boolean, Byte, Short, Integer, Long, Float, Double).
      Parameters:
      message - the message
    • toString

      public String toString()
      Overrides:
      toString in class Object