Class Message

java.lang.Object
com.swiftmq.impl.streams.comp.message.Message
Direct Known Subclasses:
BytesMessage, MapMessage, ObjectMessage, StreamMessage, TextMessage

public class Message extends Object
Facade to wrap a javax.jms.Message.
Author:
IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
  • Method Details

    • getImpl

      public MessageImpl getImpl()
      Internal use only.
    • copyProperties

      public Message copyProperties(Message source) throws JMSException
      Internal use only.
      Throws:
      JMSException
    • isSelected

      public boolean isSelected(MessageSelector selector) throws JMSException
      Internal use only.
      Throws:
      JMSException
    • type

      public String type()
      return the type of this Message
      Returns:
      "message"
    • persistent

      public Message persistent() throws JMSException
      Marks this Message as persistent.
      Returns:
      Message
      Throws:
      JMSException
    • isPersistent

      public boolean isPersistent() throws JMSException
      Returns true if this Message is persistent.
      Returns:
      true/false
      Throws:
      JMSException
    • nonpersistent

      public Message nonpersistent() throws JMSException
      Marks this Message as non-persistent.
      Returns:
      Message
      Throws:
      JMSException
    • isNonpersistent

      public boolean isNonpersistent() throws JMSException
      Returns true if this Message is non-persistent.
      Returns:
      true/false
      Throws:
      JMSException
    • destination

      public String destination() throws JMSException
      Returns the Name of the JMSDestination.
      Returns:
      Name of the JMSDestination
      Throws:
      JMSException
    • size

      public long size()
      Returns the size (bytes) of the Message.
      Returns:
      size
    • messageId

      public Message messageId(String s) throws JMSException
      Sets the JMS message ID.
      Parameters:
      s - message id
      Returns:
      Message
      Throws:
      JMSException
    • messageId

      public String messageId() throws JMSException
      Returns the JMS message ID.
      Returns:
      message id
      Throws:
      JMSException
    • correlationId

      public Message correlationId(String s) throws JMSException
      Sets the JMS correlation ID.
      Parameters:
      s - correlation id
      Returns:
      Message
      Throws:
      JMSException
    • correlationId

      public String correlationId() throws JMSException
      Returns the JMS correlation ID.
      Returns:
      correlation id
      Throws:
      JMSException
    • priority

      public Message priority(int prio) throws JMSException
      Sets the JMS priority.
      Parameters:
      prio - priority
      Returns:
      Message
      Throws:
      JMSException
    • priority

      public int priority() throws JMSException
      Returns the JMS priority
      Returns:
      priority
      Throws:
      JMSException
    • expiration

      public Message expiration(long exp) throws JMSException
      Sets the JMS expiration
      Parameters:
      exp - expiration
      Returns:
      Message
      Throws:
      JMSException
    • expiration

      public long expiration() throws JMSException
      Returns the JMS expiration.
      Returns:
      expiration
      Throws:
      JMSException
    • timestamp

      public Message timestamp(long timestamp) throws JMSException
      Sets the JMS timestamp
      Parameters:
      timestamp - time stamp
      Returns:
      Message
      Throws:
      JMSException
    • timestamp

      public long timestamp() throws JMSException
      Returns the JMS timestamp.
      Returns:
      timestamp
      Throws:
      JMSException
    • replyTo

      public Message replyTo(Destination destination) throws JMSException
      Sets the replyTo address
      Parameters:
      destination -
      Returns:
      Message
      Throws:
      JMSException
    • replyTo

      public Destination replyTo() throws JMSException
      Returns the replyTo address
      Returns:
      replyTo Address
      Throws:
      JMSException
    • property

      public Property property(String name)
      Returns the Message property with that name. If the property does not exists in the message, the value of the returned property is set to null.
      Parameters:
      name - Property name
      Returns:
      Property
    • clearBody

      public Message clearBody()
      Clears the message body.
      Returns:
      this
    • properties

      public PropertySet properties() throws Exception
      Returns a PropertySet that contains all Message Properties of this Message
      Returns:
      PropertySet
      Throws:
      Exception
    • onMessageEnabled

      public Message onMessageEnabled(boolean onMessageEnabled)
      Can be set to false in an Input callback to disable calling the onMessage Callback with this Message.
      Parameters:
      onMessageEnabled - true/false
      Returns:
      this
    • isOnMessageEnabled

      public boolean isOnMessageEnabled()
      Internal use.
    • toString

      public String toString()
      Overrides:
      toString in class Object