Class PulsarTextMessage

java.lang.Object
com.datastax.oss.pulsar.jms.PulsarMessage
com.datastax.oss.pulsar.jms.messages.PulsarTextMessage
All Implemented Interfaces:
javax.jms.Message, javax.jms.TextMessage

public final class PulsarTextMessage extends PulsarMessage implements javax.jms.TextMessage
  • Constructor Details

    • PulsarTextMessage

      public PulsarTextMessage(byte[] payload)
    • PulsarTextMessage

      public PulsarTextMessage(String text)
  • Method Details

    • messageType

      protected String messageType()
      Specified by:
      messageType in class PulsarMessage
    • isBodyAssignableTo

      public boolean isBodyAssignableTo(Class c)
      Specified by:
      isBodyAssignableTo in interface javax.jms.Message
    • clearBody

      public void clearBody() throws javax.jms.JMSException
      Specified by:
      clearBody in interface javax.jms.Message
      Throws:
      javax.jms.JMSException
    • getBody

      public <T> T getBody(Class<T> c) throws javax.jms.JMSException
      Specified by:
      getBody in interface javax.jms.Message
      Throws:
      javax.jms.JMSException
    • prepareForSend

      protected void prepareForSend(org.apache.pulsar.client.api.TypedMessageBuilder<byte[]> producer) throws javax.jms.JMSException
      Specified by:
      prepareForSend in class PulsarMessage
      Throws:
      javax.jms.JMSException
    • setText

      public void setText(String string) throws javax.jms.JMSException
      Sets the string containing this message's data.
      Specified by:
      setText in interface javax.jms.TextMessage
      Parameters:
      string - the String containing the message's data
      Throws:
      javax.jms.JMSException - if the JMS provider fails to set the text due to some internal error.
      javax.jms.MessageNotWriteableException - if the message is in read-only mode.
    • getText

      public String getText() throws javax.jms.JMSException
      Gets the string containing this message's data. The default value is null.
      Specified by:
      getText in interface javax.jms.TextMessage
      Returns:
      the String containing the message's data
      Throws:
      javax.jms.JMSException - if the JMS provider fails to get the text due to some internal error.
    • toString

      public String toString()
      Overrides:
      toString in class Object